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. --- source/blender/editors/space_nla/nla_draw.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_nla') 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); -- cgit v1.2.3