Răsfoiți Sursa

[macOS] Fix hiDPI scaling support in `OS.get_real_window_size` and `OS.set_window.size` functions.

(cherry picked from commit 1b6330b125042d727a65768b413de9cc7fe7003d)
bruvzg 6 ani în urmă
părinte
comite
754e1b073a
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      platform/osx/os_osx.mm

+ 2 - 2
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