summaryrefslogtreecommitdiff
path: root/editor/editor_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r--editor/editor_settings.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 48f04694aa..bdabff20f9 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1365,6 +1365,12 @@ float EditorSettings::get_auto_display_scale() const {
return DisplayServer::get_singleton()->screen_get_max_scale();
#else
const int screen = DisplayServer::get_singleton()->window_get_current_screen();
+
+ if (DisplayServer::get_singleton()->screen_get_size(screen) == Vector2i()) {
+ // Invalid screen size, skip.
+ return 1.0;
+ }
+
// Use the smallest dimension to use a correct display scale on portrait displays.
const int smallest_dimension = MIN(DisplayServer::get_singleton()->screen_get_size(screen).x, DisplayServer::get_singleton()->screen_get_size(screen).y);
if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && smallest_dimension >= 1400) {