Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-06-08 23:22:55 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-06-09 19:28:41 +0300
commit075156de9f5a5b80f9189f7c2e2a211e6ed24d29 (patch)
tree5a37453fae336c186146e1aa3a529c8c0632fc66 /source/blender/editors/object
parent69b67d4f07206566e979ef7645d5d1c76b9cc6b4 (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/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_remesh.c4
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);