diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-17 18:54:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-17 18:54:13 +0400 |
commit | d11888b470d03a36d60e8332e8c108ce18ea4948 (patch) | |
tree | c1843ab441b63808dc081d78a58760a932f9ae86 /intern | |
parent | 9d98b489256ef3783a5a8a1dc40b837dbc5b064d (diff) |
- wrapping failed with the cursor at the screen edge,
- changed numbuts behavior with continuous grab so dragging back after passing the button limit immediately adjusts the value
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/GHOST_Rect.h | 13 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/intern/ghost/GHOST_Rect.h b/intern/ghost/GHOST_Rect.h index 98169ad2aa4..6a29b1ffc26 100644 --- a/intern/ghost/GHOST_Rect.h +++ b/intern/ghost/GHOST_Rect.h @@ -228,20 +228,19 @@ inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y) if (y < m_t) m_t = y; if (y > m_b) m_b = y; } - +#include <stdio.h> inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs) { GHOST_TInt32 w= getWidth(); GHOST_TInt32 h= getHeight(); /* highly unlikely but avoid eternal loop */ - if(w-ofs <= 0 || h-ofs <= 0) + if(w-ofs*2 <= 0 || h-ofs*2 <= 0) return; - - while(x-ofs < m_l) x+= w; - while(y-ofs < m_t) y+= h; - while(x+ofs > m_r) x-= w; - while(y+ofs > m_b) y-= h; + while(x-ofs < m_l) x+= w-(ofs*2); + while(y-ofs < m_t) y+= h-(ofs*2); + while(x+ofs > m_r) x-= w-(ofs*2); + while(y+ofs > m_b) y-= h-(ofs*2); } inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index abf0b612f9a..122e6c55241 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -399,9 +399,7 @@ GHOST_SystemX11::processEvent(XEvent *xe) /* could also clamp to screen bounds * wrap with a window outside the view will fail atm */ - - bounds.wrapPoint(x_new, y_new, 1); /* offset of one incase blender is at screen bounds */ - + bounds.wrapPoint(x_new, y_new, 2); /* offset of one incase blender is at screen bounds */ window->getCursorGrabAccum(x_accum, y_accum); if(x_new != xme.x_root || y_new != xme.y_root) { |