[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53878] trunk/blender/source/blender/ windowmanager/intern/wm_cursors.c: Bug fix #33892

Ton Roosendaal ton at blender.org
Thu Jan 17 11:16:40 CET 2013


Revision: 53878
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53878
Author:   ton
Date:     2013-01-17 10:16:40 +0000 (Thu, 17 Jan 2013)
Log Message:
-----------
Bug fix #33892

HiDPI "retina" mode didn't work for "Continuous Grab" yet.

Note; this mode works by having different coordinate systems
for pixels and window/mouse coords. I really hope future
HiDPI implementations use the same trick.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_cursors.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_cursors.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_cursors.c	2013-01-17 09:11:51 UTC (rev 53877)
+++ trunk/blender/source/blender/windowmanager/intern/wm_cursors.c	2013-01-17 10:16:40 UTC (rev 53878)
@@ -188,12 +188,20 @@
 	 * It helps not to get a stuck WM when hitting a breakpoint  
 	 * */
 	GHOST_TGrabCursorMode mode = GHOST_kGrabNormal;
+	float fac = GHOST_GetNativePixelSize(win->ghostwin);
 
+	/* in case pixel coords differ from window/mouse coords */
+	bounds[0] /= fac;
+	bounds[1] /= fac;
+	bounds[2] /= fac;
+	bounds[3] /= fac;
+	
 	if (hide) mode = GHOST_kGrabHide;
 	else if (wrap) mode = GHOST_kGrabWrap;
 	if ((G.debug & G_DEBUG) == 0) {
 		if (win && win->ghostwin) {
 			const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
+			
 			/* Note: There is no tabletdata on Windows if no tablet device is connected. */
 			if (!tabletdata)
 				GHOST_SetCursorGrab(win->ghostwin, mode, bounds, NULL);




More information about the Bf-blender-cvs mailing list