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_text/text_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_text/text_draw.c')
-rw-r--r--source/blender/editors/space_text/text_draw.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 849766851aa..b38f92402b3 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1010,13 +1010,16 @@ static void draw_textscroll(const SpaceText *st, rcti *scroll, rcti *back)
BLI_rcti_size_y(&st->runtime.scroll_region_select));
UI_GetThemeColor3fv(TH_HILITE, col);
col[3] = 0.18f;
- UI_draw_roundbox_aa(true,
- st->runtime.scroll_region_select.xmin + 1,
- st->runtime.scroll_region_select.ymin,
- st->runtime.scroll_region_select.xmax - 1,
- st->runtime.scroll_region_select.ymax,
- rad,
- col);
+ UI_draw_roundbox_aa(
+ &(const rctf){
+ .xmin = st->runtime.scroll_region_select.xmin + 1,
+ .xmax = st->runtime.scroll_region_select.xmax - 1,
+ .ymin = st->runtime.scroll_region_select.ymin,
+ .ymax = st->runtime.scroll_region_select.ymax,
+ },
+ true,
+ rad,
+ col);
}
/*********************** draw documentation *******************************/
@@ -1180,7 +1183,14 @@ static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc
}
/* not needed but stands out nicer */
- UI_draw_box_shadow(220, x, y - boxh, x + boxw, y);
+ UI_draw_box_shadow(
+ &(const rctf){
+ .xmin = x,
+ .xmax = x + boxw,
+ .ymin = y - boxh,
+ .ymax = y,
+ },
+ 220);
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);