You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
[macOS, 3.2] Implement seamless display scaling.
This commit is contained in:
@@ -2406,8 +2406,12 @@ ProjectManager::ProjectManager() {
|
||||
switch (display_scale) {
|
||||
case 0: {
|
||||
// Try applying a suitable display scale automatically
|
||||
#ifdef OSX_ENABLED
|
||||
editor_set_scale(OS::get_singleton()->get_screen_max_scale());
|
||||
#else
|
||||
const int screen = OS::get_singleton()->get_current_screen();
|
||||
editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0);
|
||||
#endif
|
||||
} break;
|
||||
|
||||
case 1: editor_set_scale(0.75); break;
|
||||
@@ -2425,11 +2429,8 @@ ProjectManager::ProjectManager() {
|
||||
// Define a minimum window size to prevent UI elements from overlapping or being cut off
|
||||
OS::get_singleton()->set_min_window_size(Size2(750, 420) * EDSCALE);
|
||||
|
||||
#ifndef OSX_ENABLED
|
||||
// The macOS platform implementation uses its own hiDPI window resizing code
|
||||
// TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below
|
||||
OS::get_singleton()->set_window_size(OS::get_singleton()->get_window_size() * MAX(1, EDSCALE));
|
||||
#endif
|
||||
}
|
||||
|
||||
FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
|
||||
|
||||
Reference in New Issue
Block a user