From 98e4fbc7cc9e9bd6492e7bbb82e48dcf7b4d0bac Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 6 Jan 2020 22:42:21 +1100 Subject: Gizmo: use compatible scale values between 2D/3D gizmos Make the UV editor gizmos the same size as the 3D view. --- source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c | 8 +------- source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'source/blender/editors/gizmo_library') diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c index ef4fd23b64d..2e4284d357a 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c @@ -56,7 +56,6 @@ /* own includes */ #include "../gizmo_library_intern.h" -#define GIZMO_RESIZER_SIZE 10.0f #define GIZMO_MARGIN_OFFSET_SCALE 1.5f static bool gizmo_calc_rect_view_scale(const wmGizmo *gz, const float dims[2], float scale[2]) @@ -92,12 +91,7 @@ static bool gizmo_calc_rect_view_scale(const wmGizmo *gz, const float dims[2], f static bool gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[2], float margin[2]) { float handle_size; - if (gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) { - handle_size = 0.15f; - } - else { - handle_size = GIZMO_RESIZER_SIZE; - } + handle_size = 0.15f; handle_size *= gz->scale_final; float scale_xy[2]; if (!gizmo_calc_rect_view_scale(gz, dims, scale_xy)) { diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c index 723be3cfe6b..05b58903e04 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c @@ -91,13 +91,7 @@ static void gizmo_calc_rect_view_scale(const wmGizmo *gz, const float dims[3], f static void gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[3], float margin[3]) { - float handle_size; - if (gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) { - handle_size = 0.15f; - } - else { - handle_size = GIZMO_RESIZER_SIZE; - } + const float handle_size = 0.15f; // XXX, the scale isn't taking offset into account, we need to calculate scale per handle! // handle_size *= gz->scale_final; -- cgit v1.2.3