summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2014-06-29 19:04:35 -0300
committerreduz <reduzio@gmail.com>2014-06-29 19:04:35 -0300
commitc5c0969683236f13a605806b49d895c19fce2ca9 (patch)
treed35714e8f0e1919cbef5d9a418d7068a9c9ee1cf
parentc6b1571972b1f64b883cb3eab07c1875fdb3d002 (diff)
parent2482aa1362402ca26d41007b9a2fa49d84fa53aa (diff)
Merge pull request #549 from Felbo/master
Fixed mouse motion events with captured mouse mode in OS X
-rw-r--r--platform/osx/os_osx.mm9
1 files changed, 2 insertions, 7 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index c09a45bbad..12f98cebe2 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -384,15 +384,10 @@ static int button_mask=0;
ev.mouse_motion.y=mouse_y;
ev.mouse_motion.global_x=mouse_x;
ev.mouse_motion.global_y=mouse_y;
- ev.mouse_motion.relative_x=mouse_x - prev_mouse_x;
- ev.mouse_motion.relative_y=mouse_y - prev_mouse_y;
+ ev.mouse_motion.relative_x=[event deltaX] * [[event window] backingScaleFactor];
+ ev.mouse_motion.relative_y=[event deltaY] * [[event window] backingScaleFactor];
ev.mouse_motion.mod = translateFlags([event modifierFlags]);
-
-// ev.mouse_motion.relative_x=[event deltaX];
-// ev.mouse_motion.relative_y=[event deltaY];
-
-
OS_OSX::singleton->input->set_mouse_pos(Point2(mouse_x,mouse_y));
OS_OSX::singleton->push_input(ev);