summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 55da1b9e3..554c1ff42 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -1436,3 +1436,13 @@ void Gui::handleModalFocusReleased()
parent = swap->getParent();
}
}
+
+int Gui::getMousePressLength()
+{
+ if (!mLastMousePressTimeStamp)
+ return 0;
+ int ticks = SDL_GetTicks();
+ if (ticks > mLastMousePressTimeStamp)
+ return ticks - mLastMousePressTimeStamp;
+ return mLastMousePressTimeStamp - ticks;
+}