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
This commit is contained in:
Harley Acheson 2021-06-09 13:37:44 -07:00
parent 675677ec67
commit 5f19646d7e
Notes: blender-bot 2023-02-13 18:30:47 +01:00
Referenced by issue #88799, Scene statistics overlay column spacing weirdness
1 changed files with 1 additions and 1 deletions

View File

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