summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-02-22 23:06:45 +0000
committerfrosch <frosch@openttd.org>2015-02-22 23:06:45 +0000
commit352e528cdab81f1903f13260dedb34d1b113b6e8 (patch)
tree138854a4db9517f6455825ad79acdfbac9151d9d /src/video/cocoa
parentfece468d9678fd11ed5435286dd32353c61b1dcc (diff)
downloadopenttd-352e528cdab81f1903f13260dedb34d1b113b6e8.tar.xz
(svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/event.mm18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index 844b2dcd0..c8d10717e 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -362,22 +362,8 @@ static void QZ_DoUnsidedModifiers(unsigned int newMods)
static void QZ_MouseMovedEvent(int x, int y)
{
- if (_cursor.fix_at) {
- int dx = x - _cursor.pos.x;
- int dy = y - _cursor.pos.y;
-
- if (dx != 0 || dy != 0) {
- _cursor.delta.x += dx;
- _cursor.delta.y += dy;
-
- QZ_WarpCursor(_cursor.pos.x, _cursor.pos.y);
- }
- } else {
- _cursor.delta.x = x - _cursor.pos.x;
- _cursor.delta.y = y - _cursor.pos.y;
- _cursor.pos.x = x;
- _cursor.pos.y = y;
- _cursor.dirty = true;
+ if (_cursor.UpdateCursorPosition(x, y, false)) {
+ QZ_WarpCursor(_cursor.pos.x, _cursor.pos.y);
}
HandleMouseEvents();
}