summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/display_server_osx.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index 9e32cab5ed..8820201c10 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -1682,7 +1682,11 @@ Point2i DisplayServerOSX::mouse_get_position() const {
for (NSScreen *screen in [NSScreen screens]) {
NSRect frame = [screen frame];
if (NSMouseInRect(mouse_pos, frame, NO)) {
- return Vector2i((int)mouse_pos.x, (int)-mouse_pos.y) * scale + _get_screens_origin();
+ Vector2i pos = Vector2i((int)mouse_pos.x, (int)mouse_pos.y);
+ pos *= scale;
+ pos -= _get_screens_origin();
+ pos.y *= -1;
+ return pos;
}
}
return Vector2i();