diff options
| author | Rémi Verschelde | 2017-08-21 20:18:58 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-21 20:18:58 +0200 |
| commit | 01d4ffd3ee8abbbfba45871ee8d83eee18d3bf97 (patch) | |
| tree | 1cdcc541483b31d004afc8e57f4fdcd5cabc5862 /platform | |
| parent | 1be30f35a68a9fb2c156ded45c8689cc44f26f29 (diff) | |
| parent | c6edf1821e6fcbb41fd6c2a21a1017130b07e56d (diff) | |
| download | godot-01d4ffd3ee8abbbfba45871ee8d83eee18d3bf97.tar.gz godot-01d4ffd3ee8abbbfba45871ee8d83eee18d3bf97.tar.zst godot-01d4ffd3ee8abbbfba45871ee8d83eee18d3bf97.zip | |
Merge pull request #10505 from marcelofg55/osx_window_position
Fix y axis for set_window_position on OS X
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/osx/os_osx.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 6d8a6eca6..33b1e64dd 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1514,9 +1514,14 @@ Point2 OS_OSX::get_window_position() const { void OS_OSX::set_window_position(const Point2 &p_position) { - Point2 size = p_position; - size /= display_scale; - [window_object setFrame:NSMakeRect(size.x, size.y, [window_object frame].size.width, [window_object frame].size.height) display:YES]; + Size2 scr = get_screen_size(); + NSPoint pos; + + pos.x = p_position.x / display_scale; + // For OS X the y starts at the bottom + pos.y = (scr.height - p_position.y) / display_scale; + + [window_object setFrameTopLeftPoint:pos]; _update_window(); }; |
