diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-01-12 01:52:39 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-01-12 01:52:39 +0300 |
commit | 89145341e5ddcefbe71c664db8a853abe3b93344 (patch) | |
tree | 7134af7971f04917e28558d4b8974d8761b2ca9d /source/blender/editors/interface/interface_widgets.c | |
parent | bbe59c6014535b125e39f7466ee0930a07116571 (diff) |
BLF: UI_fontstyle_draw Usage
Add maximum string length argument to UI_fontstyle_draw to reduce usage
of BLF_DRAW_STR_DUMMY_MAX. Reorders arguments to UI_fontstyle_draw_ex
See D13794 for more details.
Differential Revision: https://developer.blender.org/D13794
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 06de4f09d06..b44496731f7 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2130,11 +2130,11 @@ static void widget_draw_text(const uiFontStyle *fstyle, UI_fontstyle_draw_ex(fstyle, rect, drawstr + but->ofs, + drawlen, wcol->text, &(struct uiFontStyleDraw_Params){ .align = align, }, - drawlen, &font_xofs, &font_yofs, NULL); @@ -2194,6 +2194,7 @@ static void widget_draw_text(const uiFontStyle *fstyle, UI_fontstyle_draw(fstyle, rect, drawstr_right, + UI_MAX_DRAW_STR, col, &(struct uiFontStyleDraw_Params){ .align = UI_STYLE_TEXT_RIGHT, @@ -5417,11 +5418,11 @@ void ui_draw_menu_item(const uiFontStyle *fstyle, UI_fontstyle_draw_ex(fstyle, rect, drawstr, + sizeof(drawstr), wt->wcol.text, &(struct uiFontStyleDraw_Params){ .align = UI_STYLE_TEXT_LEFT, }, - sizeof(drawstr), &xofs, &yofs, &info); @@ -5468,6 +5469,7 @@ void ui_draw_menu_item(const uiFontStyle *fstyle, UI_fontstyle_draw(fstyle, rect, hint_drawstr, + sizeof(hint_drawstr), wt->wcol.text, &(struct uiFontStyleDraw_Params){ .align = UI_STYLE_TEXT_RIGHT, @@ -5523,6 +5525,7 @@ void ui_draw_preview_item_stateless(const uiFontStyle *fstyle, UI_fontstyle_draw(fstyle, &trect, drawstr, + sizeof(drawstr), text_col, &(struct uiFontStyleDraw_Params){ .align = text_align, |