Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-01-25 10:31:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-25 10:34:29 +0300
commit0cb264a282626d1f363d1898695f44285e1e0027 (patch)
treef35b894c87fd338e71584b5b21d84337e0a73c19 /source/blender/editors/space_outliner/outliner_draw.c
parent17ac860cefe66cbb2abae3448d4a949a6fccc520 (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/space_outliner/outliner_draw.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c39
1 files changed, 30 insertions, 9 deletions
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. */
}