[Bf-blender-cvs] [5f19646d7ed] master: Fix T88799: 3DViewport Stats Column Measurements

Harley Acheson noreply at git.blender.org
Wed Jun 9 22:39:18 CEST 2021


Commit: 5f19646d7edef02479bccd7e898f072c9e54ac6e
Author: Harley Acheson
Date:   Wed Jun 9 13:37:44 2021 -0700
Branches: master
https://developer.blender.org/rB5f19646d7edef02479bccd7e898f072c9e54ac6e

Fix T88799: 3DViewport Stats Column Measurements

To draw the overlay stats in columns the strings must be measured to
find the longest one. In some circumstances this measurement can be
incorrect. We draw the text with a specific size yet do not explicitly
set the size before calling BLF_size. This patch properly sets the size
so that the measurement will match what will be used for output.

See T88799 for examples of measurement failure.

Differential Revision: https://developer.blender.org/D11504

Reviewed by Hans Goudey

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

M	source/blender/editors/space_info/info_stats.c

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

diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index cf847fa18a8..ebdf32a1cdb 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -693,7 +693,7 @@ void ED_info_draw_stats(
   Object *ob = OBACT(view_layer);
   Object *obedit = OBEDIT_FROM_OBACT(ob);
   eObjectMode object_mode = ob ? ob->mode : OB_MODE_OBJECT;
-  const int font_id = BLF_default();
+  const int font_id = BLF_set_default();
 
   UI_FontThemeColor(font_id, TH_TEXT_HI);
   BLF_enable(font_id, BLF_SHADOW);



More information about the Bf-blender-cvs mailing list