summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2019-03-12 11:41:41 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2019-03-12 11:41:41 +0200
commit1b6330b125042d727a65768b413de9cc7fe7003d (patch)
treee526124589ba51bf5a38e727306e24d3a40db7b8 /platform
parent6d86450a8356b8930b503c8ff5cc07d9e34e6287 (diff)
[macOS] Fix hiDPI scaling support in `OS.get_real_window_size` and `OS.set_window.size` functions.
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/os_osx.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index b45d0d80e6..7d2116ba7e 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -2270,12 +2270,12 @@ Size2 OS_OSX::get_window_size() const {
Size2 OS_OSX::get_real_window_size() const {
NSRect frame = [window_object frame];
- return Size2(frame.size.width, frame.size.height);
+ return Size2(frame.size.width, frame.size.height) * _display_scale();
}
void OS_OSX::set_window_size(const Size2 p_size) {
- Size2 size = p_size;
+ Size2 size = p_size / _display_scale();
if (get_borderless_window() == false) {
// NSRect used by setFrame includes the title bar, so add it to our size.y