From e9301ddce5a6ddf77dafc1f56f0b1461b2092c6f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 3 Dec 2012 00:00:28 +0300 Subject: Add support for relative mouse move in android version. --- src/touchmanager.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/touchmanager.cpp') diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index f2c91f867..8afc35119 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -23,6 +23,7 @@ #include "configuration.h" #include "graphics.h" #include "graphicsvertexes.h" +#include "mouseinput.h" #include "touchactions.h" #include "gui/theme.h" @@ -161,10 +162,10 @@ void TouchManager::draw() } } -bool TouchManager::processEvent(const gcn::MouseInput &mouseInput) +bool TouchManager::processEvent(const MouseInput &mouseInput) { - const int x = mouseInput.getX(); - const int y = mouseInput.getY(); + const int x = mouseInput.getTouchX(); + const int y = mouseInput.getTouchY(); for (TouchItemVectorCIter it = mObjects.begin(), it_end = mObjects.end(); it != it_end; ++ it) @@ -175,9 +176,9 @@ bool TouchManager::processEvent(const gcn::MouseInput &mouseInput) const gcn::Rectangle &rect = item->rect; if (rect.isPointInRect(x, y)) { - gcn::MouseInput event = mouseInput; - event.setX(event.getX() - item->x); - event.setY(event.getY() - item->y); + MouseInput event = mouseInput; + event.setX(event.getTouchX() - item->x); + event.setY(event.getTouchY() - item->y); if (item->funcAll) item->funcAll(event); -- cgit v1.2.3-70-g09d2