Adjust auto scale on high res displays

This commit is contained in:
Ansraer 2021-02-12 00:07:19 +01:00
parent e5bb89cdd5
commit 466cf0b466
3 changed files with 12 additions and 0 deletions

View file

@ -5671,6 +5671,10 @@ EditorNode::EditorNode() {
if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) {
// hiDPI display. // hiDPI display.
scale = 2.0; 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) { } 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. // 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. // Icons won't look great, but this is better than having editor elements overflow from its window.

View file

@ -337,6 +337,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) {
// hiDPI display. // hiDPI display.
scale = 2.0; 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) { } 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. // 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. // Icons won't look great, but this is better than having editor elements overflow from its window.

View file

@ -2385,6 +2385,10 @@ ProjectManager::ProjectManager() {
if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) { if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).y >= 1400) {
// hiDPI display. // hiDPI display.
scale = 2.0; 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) { } 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. // 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. // Icons won't look great, but this is better than having editor elements overflow from its window.