diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-04 21:04:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-04 21:16:36 +0300 |
commit | 92b06e397e5d18b24584dfaf5869929a9579b314 (patch) | |
tree | 2675d073617c3da39ee0ae134629b91f013a8185 /src/gui/gui.cpp | |
parent | 6ed69c8769cd6c8c79c77fc8116059b42f3653e7 (diff) | |
download | ManaVerse-92b06e397e5d18b24584dfaf5869929a9579b314.tar.gz ManaVerse-92b06e397e5d18b24584dfaf5869929a9579b314.tar.bz2 ManaVerse-92b06e397e5d18b24584dfaf5869929a9579b314.tar.xz ManaVerse-92b06e397e5d18b24584dfaf5869929a9579b314.zip |
prevent mouse cursor moving in android in onscreen controls.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e243bfc27..13290975a 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -89,6 +89,10 @@ Gui::Gui(Graphics *const graphics) : mMouseCursorAlpha(1.0f), mMouseInactivityTimer(0), mCursorType(Cursor::CURSOR_POINTER), +#ifdef ANDROID + mLastMouseRealX(0), + mLastMouseRealY(0), +#endif mFocusListeners(), mCustomCursor(false) { @@ -687,6 +691,10 @@ void Gui::handleMouseInput() if (touchManager.processEvent(mouseInput)) { +#ifdef ANDROID + SDL_WarpMouse(mLastMouseX, mLastMouseY, + mLastMouseRealX, mLastMouseRealY); +#endif mMouseInactivityTimer = 0; continue; } @@ -695,7 +703,10 @@ void Gui::handleMouseInput() // changes or modal mouse input focus changes. mLastMouseX = mouseInput.getX(); mLastMouseY = mouseInput.getY(); - +#ifdef ANDROID + mLastMouseRealX = mouseInput.getRealX(); + mLastMouseRealY = mouseInput.getRealY(); +#endif switch (mouseInput.getType()) { case gcn::MouseInput::PRESSED: |