Fix #119183: Use valid style for popup text size calculation

The current font style can be overridden with a input or other widget text style,
this change ensures that the right font style is set so `BLF_width` don't use a
overridden font text style.

Pull Request: https://projects.blender.org/blender/blender/pulls/119442
This commit is contained in:
Guillermo Venegas
2024-03-13 23:01:58 +01:00
committed by Harley Acheson
parent d562a9ce43
commit 1640121a63

View File

@@ -1506,6 +1506,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *region, void *user_
UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_NUMSELECT);
UI_fontstyle_set(&style->widget);
/* Width based on the text lengths. */
int text_width = std::max(
120 * UI_SCALE_FAC,