From 5c822f77f455f9f4d3bc74fed5f71b02ddfaa7c7 Mon Sep 17 00:00:00 2001 From: Abhinav Chennubhotla Date: Wed, 29 Mar 2023 13:25:26 +0530 Subject: [PATCH 1/2] Fix #97049: Auto-keyframing warning message shows on top of navigator - Broken for "Simple Axis" (USER_MINI_AXIS_TYPE_MINIMAL), falls back to the same offset as USER_MINI_AXIS_TYPE_GIZMO --- source/blender/editors/transform/transform.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 78a42f1a3d8..bd3003c7131 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1445,14 +1445,29 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *region) const char *printable = IFACE_("Auto Keying On"); float printable_size[2]; int xco, yco; + int offset = 0; const rcti *rect = ED_region_visible_rect(region); - const int font_id = BLF_default(); + const int font_id = BLF_set_default(); BLF_width_and_height( font_id, printable, BLF_DRAW_STR_DUMMY_MAX, &printable_size[0], &printable_size[1]); - xco = (rect->xmax - U.widget_unit) - (int)printable_size[0]; + switch ((eUserpref_MiniAxisType)U.mini_axis_type) { + case USER_MINI_AXIS_TYPE_GIZMO: + offset = U.gizmo_size_navigate_v3d; + break; + case USER_MINI_AXIS_TYPE_MINIMAL: + offset = U.gizmo_size_navigate_v3d; // this part is wrong and should be changed + break; + case USER_MINI_AXIS_TYPE_NONE: + offset = 25; + break; + } + + offset *= U.scale_factor; + + xco = (rect->xmax - U.widget_unit) - (int)printable_size[0] - offset; yco = (rect->ymax - U.widget_unit); /* warning text (to clarify meaning of overlays) -- 2.30.2 From 3fab8dea45ff00088b1b843aa6d3d1230b5f253c Mon Sep 17 00:00:00 2001 From: Abhinav Chennubhotla Date: Wed, 29 Mar 2023 22:35:03 +0530 Subject: [PATCH 2/2] Fix offset value for USER_MINI_AXIS_TYPE_MINIMAL --- source/blender/editors/transform/transform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index bd3003c7131..468b5c7e334 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1458,10 +1458,10 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *region) offset = U.gizmo_size_navigate_v3d; break; case USER_MINI_AXIS_TYPE_MINIMAL: - offset = U.gizmo_size_navigate_v3d; // this part is wrong and should be changed + offset = U.rvisize * 1.2f; // Scaled by 1.2 so it's not touching the gizmo break; case USER_MINI_AXIS_TYPE_NONE: - offset = 25; + offset = 25; // Just a number that works based on empirical testing break; } -- 2.30.2