[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24906] trunk/blender/intern/ghost/intern/ GHOST_Window.cpp: Cursor Grab bugfix: passing NULL for bounds didn' t initialize properly.

Martin Poirier theeth at yahoo.com
Thu Nov 26 03:58:58 CET 2009


Revision: 24906
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24906
Author:   theeth
Date:     2009-11-26 03:58:53 +0100 (Thu, 26 Nov 2009)

Log Message:
-----------
Cursor Grab bugfix: passing NULL for bounds didn't initialize properly.

Symptom: first button drag gets stuck on values.

Cause: Buttons didn't set grab bounds, to use the whole window. But Ghost didn't do anything in that case, it left the bounds value as is. It only affected the first cursor grab, because cursor ungrab sets it to -1, which forces it to use the whole window size (checking every mouse move) for subsequent grabs.

Solution: When NULL, init bounds to window size (and don't query every mouse move).

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_Window.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_Window.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_Window.cpp	2009-11-26 02:13:56 UTC (rev 24905)
+++ trunk/blender/intern/ghost/intern/GHOST_Window.cpp	2009-11-26 02:58:53 UTC (rev 24906)
@@ -109,6 +109,8 @@
 			m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1;
 		else if (bounds) {
 			m_cursorGrabBounds= *bounds;
+		} else { /* if bounds not defined, use window */
+			getClientBounds(m_cursorGrabBounds);
 		}
 		m_cursorGrab = mode;
 		return GHOST_kSuccess;





More information about the Bf-blender-cvs mailing list