From 0cb264a282626d1f363d1898695f44285e1e0027 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Jan 2021 18:31:11 +1100 Subject: 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. --- .../blender/editors/space_outliner/outliner_draw.c | 39 +++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner_draw.c') diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 15590222423..d424bb2319a 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2695,13 +2695,16 @@ static void outliner_draw_iconrow_number(const uiFontStyle *fstyle, float offset_x = (float)offsx + UI_UNIT_X * 0.35f; UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa(true, - offset_x + ufac, - (float)ys - UI_UNIT_Y * 0.2f + ufac, - offset_x + UI_UNIT_X - ufac, - (float)ys - UI_UNIT_Y * 0.2f + UI_UNIT_Y - ufac, - (float)UI_UNIT_Y / 2.0f - ufac, - color); + UI_draw_roundbox_aa( + &(const rctf){ + .xmin = offset_x + ufac, + .xmax = offset_x + UI_UNIT_X - ufac, + .ymin = (float)ys - UI_UNIT_Y * 0.2f + ufac, + .ymax = (float)ys - UI_UNIT_Y * 0.2f + UI_UNIT_Y - ufac, + }, + true, + (float)UI_UNIT_Y / 2.0f - ufac, + color); /* Now the numbers. */ uchar text_col[4]; @@ -2751,8 +2754,26 @@ static void outliner_draw_active_indicator(const float minx, const float radius = UI_UNIT_Y / 4.0f; UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa(true, minx, miny + ufac, maxx, maxy - ufac, radius, icon_color); - UI_draw_roundbox_aa(false, minx, miny + ufac, maxx, maxy - ufac, radius, icon_border); + UI_draw_roundbox_aa( + &(const rctf){ + .xmin = minx, + .xmax = maxx, + .ymin = miny + ufac, + .ymax = maxy - ufac, + }, + true, + radius, + icon_color); + UI_draw_roundbox_aa( + &(const rctf){ + .xmin = minx, + .xmax = maxx, + .ymin = miny + ufac, + .ymax = maxy - ufac, + }, + false, + radius, + icon_border); GPU_blend(GPU_BLEND_ALPHA); /* Roundbox disables. */ } -- cgit v1.2.3