summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-09 17:14:13 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-09 17:14:13 +0300
commitd3c403e2ee342f29b7eda11cce0c113b01dd981a (patch)
tree0f5874fabf4698a991b445336dbb05d3165ff76d /src
parent00f9e6e9983a3055a6d21a3bf84d6e7699fe4138 (diff)
downloadmanaverse-d3c403e2ee342f29b7eda11cce0c113b01dd981a.tar.gz
manaverse-d3c403e2ee342f29b7eda11cce0c113b01dd981a.tar.bz2
manaverse-d3c403e2ee342f29b7eda11cce0c113b01dd981a.tar.xz
manaverse-d3c403e2ee342f29b7eda11cce0c113b01dd981a.zip
fix long mouse press.
Diffstat (limited to 'src')
-rw-r--r--src/gui/viewport.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 44e3aaa7d..7cf0cb1b1 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -519,7 +519,10 @@ void Viewport::mousePressed(MouseEvent &event)
if (!mLongMouseClick && eventButton == MouseEvent::LEFT)
{
if (leftMouseAction())
+ {
+ mPlayerFollowMouse = false;
return;
+ }
}
else if (eventButton == MouseEvent::MIDDLE)
{
@@ -659,9 +662,6 @@ void Viewport::walkByMouse(MouseEvent &event)
void Viewport::mouseDragged(MouseEvent &event)
{
- if (mLongMouseClick)
- return;
-
walkByMouse(event);
}
@@ -678,17 +678,18 @@ void Viewport::mouseReleased(MouseEvent &event)
// long button press
if (gui && gui->isLongPress())
{
- openContextMenu(event);
- gui->resetClickCount();
+ if (openContextMenu(event))
+ {
+ gui->resetClickCount();
+ return;
+ }
}
else
{
if (leftMouseAction())
return;
- if (event.getSource() != this)
- return;
- walkByMouse(event);
}
+ walkByMouse(event);
}
}
}