[Bf-blender-cvs] [bbf2db8] master: Fix View3D 'Auto Keying' alignment (when dpi!=72)

Campbell Barton noreply at git.blender.org
Thu Sep 4 07:58:15 CEST 2014


Commit: bbf2db82a2c1525a262820b65e2f8b93f85a2445
Author: Campbell Barton
Date:   Thu Sep 4 15:56:40 2014 +1000
Branches: master
https://developer.blender.org/rBbbf2db82a2c1525a262820b65e2f8b93f85a2445

Fix View3D 'Auto Keying' alignment (when dpi!=72)

===================================================================

M	source/blender/editors/transform/transform.c

===================================================================

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index a85801a..008022a 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1838,24 +1838,26 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
 	
 	BLF_width_and_height_default(printable, BLF_DRAW_STR_DUMMY_MAX, &printable_size[0], &printable_size[1]);
 	
-	xco = rect.xmax - (int)printable_size[0] - 10;
-	yco = rect.ymax - (int)printable_size[1] - 10;
+	xco = (rect.xmax - U.widget_unit) - (int)printable_size[0];
+	yco = (rect.ymax - U.widget_unit);
 	
 	/* warning text (to clarify meaning of overlays)
 	 * - original color was red to match the icon, but that clashes badly with a less nasty border
 	 */
 	UI_ThemeColorShade(TH_TEXT_HI, -50);
 #ifdef WITH_INTERNATIONAL
-	BLF_draw_default(xco, ar->winy - 17, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
+	BLF_draw_default(xco, yco, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
 #else
-	BLF_draw_default_ascii(xco, ar->winy - 17, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
+	BLF_draw_default_ascii(xco, yco, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
 #endif
 	
 	/* autokey recording icon... */
 	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 	glEnable(GL_BLEND);
 	
-	xco -= (ICON_DEFAULT_WIDTH + 2);
+	xco -= U.widget_unit;
+	yco -= (int)printable_size[1] / 2;
+
 	UI_icon_draw(xco, yco, ICON_REC);
 	
 	glDisable(GL_BLEND);




More information about the Bf-blender-cvs mailing list