From 075156de9f5a5b80f9189f7c2e2a211e6ed24d29 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Mon, 8 Jun 2020 22:22:55 +0200 Subject: 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 --- source/blender/editors/object/object_remesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/object') 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); -- cgit v1.2.3