[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38129] trunk/blender/intern/ghost/intern/ GHOST_SystemCocoa.mm: Fix #27865: weird mouse warping with continuous grab on OS X.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jul 5 22:15:29 CEST 2011


Revision: 38129
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38129
Author:   blendix
Date:     2011-07-05 20:15:29 +0000 (Tue, 05 Jul 2011)
Log Message:
-----------
Fix #27865: weird mouse warping with continuous grab on OS X.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2011-07-05 19:45:26 UTC (rev 38128)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2011-07-05 20:15:29 UTC (rev 38129)
@@ -1498,15 +1498,18 @@
 						GHOST_TInt32 x_mouse= mousePos.x;
 						GHOST_TInt32 y_mouse= mousePos.y;
 						GHOST_TInt32 x_accum, y_accum, x_cur, y_cur, x, y;
-						GHOST_Rect bounds, correctedBounds;
+						GHOST_Rect bounds, windowBounds, correctedBounds;
 						
 						/* fallback to window bounds */
 						if(window->getCursorGrabBounds(bounds)==GHOST_kFailure)
 							window->getClientBounds(bounds);
 						
 						//Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates
-						window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_b);
-						window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_t);
+						window->getClientBounds(windowBounds);
+						window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_t);
+						window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_b);
+						correctedBounds.m_b = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_b;
+						correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t;
 						
 						//Update accumulation counts
 						window->getCursorGrabAccum(x_accum, y_accum);




More information about the Bf-blender-cvs mailing list