From 466cf0b466570f70ac4dc0f5a8a4b58f513a1545 Mon Sep 17 00:00:00 2001 From: Ansraer Date: Fri, 12 Feb 2021 00:07:19 +0100 Subject: Adjust auto scale on high res displays --- editor/editor_node.cpp | 4 ++++ editor/editor_settings.cpp | 4 ++++ editor/project_manager.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index e7291b014f..dba19df578 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5671,6 +5671,10 @@ EditorNode::EditorNode() { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { // hiDPI display. scale = 2.0; + } else if (DisplayServer::get_singleton()->screen_get_size(screen).y >= 1700) { + // Likely a hiDPI display, but we aren't certain due to the returned DPI. + // Use an intermediate scale to handle this situation. + scale = 1.5; } else if (DisplayServer::get_singleton()->screen_get_size(screen).y <= 800) { // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. // Icons won't look great, but this is better than having editor elements overflow from its window. diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d813ae9353..b874139022 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -337,6 +337,10 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { // hiDPI display. scale = 2.0; + } else if (DisplayServer::get_singleton()->screen_get_size(screen).y >= 1700) { + // Likely a hiDPI display, but we aren't certain due to the returned DPI. + // Use an intermediate scale to handle this situation. + scale = 1.5; } else if (DisplayServer::get_singleton()->screen_get_size(screen).y <= 800) { // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. // Icons won't look great, but this is better than having editor elements overflow from its window. diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index afbed0c610..16d319a5d5 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2385,6 +2385,10 @@ ProjectManager::ProjectManager() { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { // hiDPI display. scale = 2.0; + } else if (DisplayServer::get_singleton()->screen_get_size(screen).y >= 1700) { + // Likely a hiDPI display, but we aren't certain due to the returned DPI. + // Use an intermediate scale to handle this situation. + scale = 1.5; } else if (DisplayServer::get_singleton()->screen_get_size(screen).y <= 800) { // Small loDPI display. Use a smaller display scale so that editor elements fit more easily. // Icons won't look great, but this is better than having editor elements overflow from its window. -- cgit v1.2.3