aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/mouse_event.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-04-05 01:52:52 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-04-05 01:52:52 +0200
commit62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd (patch)
treed4c74b5ca58db570a7856e08abd736652d98b492 /src/menu/mouse_event.cpp
parentfe9648fa1cdc8f9cf5216a88fadb8b96604047fd (diff)
downloadusdx-cpp.tar.gz
usdx-cpp.tar.xz
usdx-cpp.zip
compat/chrono_literals: Add C++14 backport.cpp
Add user-defined literals for duration types (like the ones from C++14), Because these are user-defined they start with an underscore.
Diffstat (limited to 'src/menu/mouse_event.cpp')
-rw-r--r--src/menu/mouse_event.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/menu/mouse_event.cpp b/src/menu/mouse_event.cpp
index 3f4104a0..ddcc00f2 100644
--- a/src/menu/mouse_event.cpp
+++ b/src/menu/mouse_event.cpp
@@ -25,6 +25,7 @@
#include <cstddef>
#include "mouse_event.hpp"
+#include "utils/compat/chrono_literals.hpp"
namespace usdx
{
@@ -48,17 +49,17 @@ namespace usdx
{
if (direction == UP) {
if (this->direction == DOWN) {
- if (time.since(std::chrono::milliseconds{5000}))
+ if (time.since(5000_ms))
return CLICK;
}
else if (this->direction == CLICK) {
- if (time.since(std::chrono::milliseconds{5000}))
+ if (time.since(5000_ms))
return DBL_CLICK;
}
}
else if (direction == DOWN) {
if (this->direction == CLICK &&
- time.since(std::chrono::milliseconds{5000}))
+ time.since(5000_ms))
return CLICK;
}
}