summaryrefslogtreecommitdiff
path: root/src/touchmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-03 00:00:28 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-03 00:00:28 +0300
commite9301ddce5a6ddf77dafc1f56f0b1461b2092c6f (patch)
treec9a1ed0ef0d9b15a1b3d617f9a17999bed768ff7 /src/touchmanager.cpp
parent0b228c1ed05177a761dce44df31f087c0313dc64 (diff)
downloadmv-e9301ddce5a6ddf77dafc1f56f0b1461b2092c6f.tar.gz
mv-e9301ddce5a6ddf77dafc1f56f0b1461b2092c6f.tar.bz2
mv-e9301ddce5a6ddf77dafc1f56f0b1461b2092c6f.tar.xz
mv-e9301ddce5a6ddf77dafc1f56f0b1461b2092c6f.zip
Add support for relative mouse move in android version.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r--src/touchmanager.cpp13
1 files changed, 7 insertions, 6 deletions
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);