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/space_nla/nla_draw.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/space_nla/nla_draw.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6fe980cf657..eea81e425c2 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -493,7 +493,18 @@ static void nla_draw_strip(SpaceNla *snla, /* strip is in normal track */ UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ - UI_draw_roundbox_shade_x(true, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1, color); + UI_draw_roundbox_shade_x( + &(const rctf){ + .xmin = strip->start, + .xmax = strip->end, + .ymin = yminc, + .ymax = ymaxc, + }, + true, + 0.0, + 0.5, + 0.1, + color); /* restore current vertex format & program (roundbox trashes it) */ shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -547,7 +558,18 @@ static void nla_draw_strip(SpaceNla *snla, } else { /* non-muted - draw solid, rounded outline */ - UI_draw_roundbox_shade_x(false, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1, color); + UI_draw_roundbox_shade_x( + &(const rctf){ + .xmin = strip->start, + .xmax = strip->end, + .ymin = yminc, + .ymax = ymaxc, + }, + false, + 0.0, + 0.0, + 0.1, + color); /* restore current vertex format & program (roundbox trashes it) */ shdr_pos = nla_draw_use_dashed_outlines(color, muted); |