Merge pull request #59465 from fountainment/fix_popupmenu

This commit is contained in:
Rémi Verschelde 2022-03-24 12:52:42 +01:00 committed by GitHub
commit 391633760b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1682,7 +1682,11 @@ Point2i DisplayServerOSX::mouse_get_position() const {
for (NSScreen *screen in [NSScreen screens]) { for (NSScreen *screen in [NSScreen screens]) {
NSRect frame = [screen frame]; NSRect frame = [screen frame];
if (NSMouseInRect(mouse_pos, frame, NO)) { 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(); return Vector2i();