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_view3d/view3d_gizmo_navigate_type.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_view3d/view3d_gizmo_navigate_type.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 07264f75d19..4ac16e8fbe8 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -162,7 +162,16 @@ static void gizmo_axis_draw(const bContext *C, wmGizmo *gz)
const float rad = WIDGET_RADIUS;
GPU_matrix_push();
GPU_matrix_scale_1f(1.0f / rad);
- UI_draw_roundbox_4fv(true, -rad, -rad, rad, rad, rad, gz->color_hi);
+ UI_draw_roundbox_4fv(
+ &(const rctf){
+ .xmin = -rad,
+ .xmax = rad,
+ .ymin = -rad,
+ .ymax = rad,
+ },
+ true,
+ rad,
+ gz->color_hi);
GPU_matrix_pop();
}
@@ -248,7 +257,18 @@ static void gizmo_axis_draw(const bContext *C, wmGizmo *gz)
float scale = ((depth + 1) * 0.08f) + 0.92f;
const float rad = WIDGET_RADIUS * AXIS_HANDLE_SIZE * scale;
UI_draw_roundbox_4fv_ex(
- -rad, -rad, rad, rad, inner_color, NULL, 0.0f, outline_color, AXIS_RING_WIDTH, rad);
+ &(const rctf){
+ .xmin = -rad,
+ .xmax = rad,
+ .ymin = -rad,
+ .ymax = rad,
+ },
+ inner_color,
+ NULL,
+ 0.0f,
+ outline_color,
+ AXIS_RING_WIDTH,
+ rad);
GPU_matrix_pop();
}