1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #24 from jeremycw/osx-retina

Fix mouse coordinates on OS X retina displays
This commit is contained in:
okamstudio
2014-02-13 12:03:34 -02:00

View File

@@ -378,8 +378,8 @@ static int button_mask=0;
prev_mouse_y=mouse_y; prev_mouse_y=mouse_y;
const NSRect contentRect = [OS_OSX::singleton->window_view frame]; const NSRect contentRect = [OS_OSX::singleton->window_view frame];
const NSPoint p = [event locationInWindow]; const NSPoint p = [event locationInWindow];
mouse_x = p.x; mouse_x = p.x * [[event window] backingScaleFactor];
mouse_y = contentRect.size.height - p.y; mouse_y = (contentRect.size.height - p.y) * [[event window] backingScaleFactor];
ev.mouse_motion.x=mouse_x; ev.mouse_motion.x=mouse_x;
ev.mouse_motion.y=mouse_y; ev.mouse_motion.y=mouse_y;
ev.mouse_motion.global_x=mouse_x; ev.mouse_motion.global_x=mouse_x;