diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 10:31:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 10:34:29 +0300 |
commit | 0cb264a282626d1f363d1898695f44285e1e0027 (patch) | |
tree | f35b894c87fd338e71584b5b21d84337e0a73c19 /source/blender/editors/interface/interface_style.c | |
parent | 17ac860cefe66cbb2abae3448d4a949a6fccc520 (diff) |
Cleanup: pass 'rctf' rectangle to 2D box drawing functions
Passing 4x arguments for the rectangle,
mixed in with round-box radius & color wasn't very readable.
Instead, pass a `rctf` as the first argument to UI box drawing functions.
Diffstat (limited to 'source/blender/editors/interface/interface_style.c')
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index a37fb0dfde1..eaefc2c3736 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -341,13 +341,16 @@ void UI_fontstyle_draw_simple_backdrop(const uiFontStyle *fs, const float color[4] = {col_bg[0], col_bg[1], col_bg[2], 0.5f}; UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa(true, - x - margin, - (y + decent) - margin, - x + width + margin, - (y + decent) + height + margin, - margin, - color); + UI_draw_roundbox_aa( + &(const rctf){ + .xmin = x - margin, + .xmax = x + width + margin, + .ymin = (y + decent) - margin, + .ymax = (y + decent) + height + margin, + }, + true, + margin, + color); } BLF_position(fs->uifont_id, x, y, 0.0f); |