summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/window.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 2379f173b..2c12dbe8e 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2188,21 +2188,19 @@ void HandleMouseEvents()
assert(IsGeneratingWorld() || _local_company == _current_company);
static int double_click_time = 0;
- static int double_click_x = 0;
- static int double_click_y = 0;
+ static Point double_click_pos = {0, 0};
/* Mouse event? */
MouseClick click = MC_NONE;
if (_left_button_down && !_left_button_clicked) {
click = MC_LEFT;
if (double_click_time != 0 && _realtime_tick - double_click_time < TIME_BETWEEN_DOUBLE_CLICK &&
- double_click_x != 0 && abs(_cursor.pos.x - double_click_x) < MAX_OFFSET_DOUBLE_CLICK &&
- double_click_y != 0 && abs(_cursor.pos.y - double_click_y) < MAX_OFFSET_DOUBLE_CLICK) {
+ double_click_pos.x != 0 && abs(_cursor.pos.x - double_click_pos.x) < MAX_OFFSET_DOUBLE_CLICK &&
+ double_click_pos.y != 0 && abs(_cursor.pos.y - double_click_pos.y) < MAX_OFFSET_DOUBLE_CLICK) {
click = MC_DOUBLE_LEFT;
}
double_click_time = _realtime_tick;
- double_click_x = _cursor.pos.x;
- double_click_y = _cursor.pos.y;
+ double_click_pos = _cursor.pos;
_left_button_clicked = true;
_input_events_this_tick++;
} else if (_right_button_clicked) {