[Bf-blender-cvs] [075156de9f5] master: Voxel Size Edit: Fix text not readable when zooming in the viewport

Pablo Dobarro noreply at git.blender.org
Tue Jun 9 18:29:05 CEST 2020


Commit: 075156de9f5a5b80f9189f7c2e2a211e6ed24d29
Author: Pablo Dobarro
Date:   Mon Jun 8 22:22:55 2020 +0200
Branches: master
https://developer.blender.org/rB075156de9f5a5b80f9189f7c2e2a211e6ed24d29

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

===================================================================

M	source/blender/editors/object/object_remesh.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list