From a0c0eefd5d3a5d61302b8cf8f2128e002e88968a Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 2 Dec 2024 20:04:03 +0100 Subject: [PATCH] Fix #106849: Sculpt Edit Voxel Size text too big (applies UI scale twice) There has already been some work on the placement/size of the text displayed by the Edit Voxel Size operator (see b65ab293105d & 0c98bb75cb1b), so it already sets up a suiting matrix in `VoxelSizeEditCustomData` > `text_mat`. This includes having called `ED_view3d_pixel_size` and this takes into account the UI resolution scale already afaict. So in order to resolve, just remove the multiplication by UI_SCALE_FAC. Fixes #106849 Pull Request: https://projects.blender.org/blender/blender/pulls/131093 --- source/blender/editors/object/object_remesh.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index 88a5802497f..1cd7603bb00 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -333,7 +333,8 @@ static void voxel_size_edit_draw(const bContext *C, ARegion * /*region*/, void * GPU_matrix_push(); GPU_matrix_mul(cd->text_mat); - BLF_size(fontid, 10.0f * fstyle_points * UI_SCALE_FAC); + /* Resolution scale is already accounted for in 'text_mat'. */ + BLF_size(fontid, 10.0f * fstyle_points); BLF_color3f(fontid, 1.0f, 1.0f, 1.0f); BLF_width_and_height(fontid, str, strdrawlen, &strwidth, &strheight); BLF_position(fontid, -0.5f * strwidth, -0.5f * strheight, 0.0f);