diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-06-08 23:22:55 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-06-09 19:28:41 +0300 |
commit | 075156de9f5a5b80f9189f7c2e2a211e6ed24d29 (patch) | |
tree | 5a37453fae336c186146e1aa3a529c8c0632fc66 /source | |
parent | 69b67d4f07206566e979ef7645d5d1c76b9cc6b4 (diff) |
Voxel Size Edit: Fix text not readable when zooming in the viewport
Previously the scale of the text was using object space, so when working
with scaled objects or small meshes the size of the text was wrong. Now
it calculates a scale in screen space, so the text size should be much
more predictable
Reviewed By: sergey, Severin
Differential Revision: https://developer.blender.org/D7941
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_remesh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c index 71f0230237d..1d7920b9991 100644 --- a/source/blender/editors/object/object_remesh.c +++ b/source/blender/editors/object/object_remesh.c @@ -569,8 +569,8 @@ static int voxel_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *ev copy_v3_v3(cd->text_mat[3], text_pos); /* Scale the text. */ - unit_m4(scale_mat); - scale_m4_fl(scale_mat, 0.0008f); + const float pixelsize = ED_view3d_pixel_size(rv3d, text_pos); + scale_m4_fl(scale_mat, pixelsize * 0.5f); mul_m4_m4_post(cd->text_mat, scale_mat); WM_event_add_modal_handler(C, op); |