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/animation/time_scrub_ui.c | 36 ++++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/animation/time_scrub_ui.c') diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index 98b4d93fbf1..f5240d67cca 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -124,23 +124,29 @@ static void draw_current_frame(const Scene *scene, UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_3fv_alpha(true, - frame_x - box_width / 2 + U.pixelsize / 2, - scrub_region_rect->ymin + box_padding, - frame_x + box_width / 2 + U.pixelsize / 2, - scrub_region_rect->ymax - box_padding, - 4 * UI_DPI_FAC, - bg_color, - 1.0f); + UI_draw_roundbox_3fv_alpha( + &(const rctf){ + .xmin = frame_x - box_width / 2 + U.pixelsize / 2, + .xmax = frame_x + box_width / 2 + U.pixelsize / 2, + .ymin = scrub_region_rect->ymin + box_padding, + .ymax = scrub_region_rect->ymax - box_padding, + }, + true, + 4 * UI_DPI_FAC, + bg_color, + 1.0f); UI_GetThemeColorShade4fv(TH_CFRAME, 5, bg_color); - UI_draw_roundbox_aa(false, - frame_x - box_width / 2 + U.pixelsize / 2, - scrub_region_rect->ymin + box_padding, - frame_x + box_width / 2 + U.pixelsize / 2, - scrub_region_rect->ymax - box_padding, - 4 * UI_DPI_FAC, - bg_color); + UI_draw_roundbox_aa( + &(const rctf){ + .xmin = frame_x - box_width / 2 + U.pixelsize / 2, + .xmax = frame_x + box_width / 2 + U.pixelsize / 2, + .ymin = scrub_region_rect->ymin + box_padding, + .ymax = scrub_region_rect->ymax - box_padding, + }, + true, + 4 * UI_DPI_FAC, + bg_color); uchar text_color[4]; UI_GetThemeColor4ubv(TH_HEADER_TEXT_HI, text_color); -- cgit v1.2.3