소스 검색

Adjust auto scale on high res displays

(cherry picked from commit 466cf0b466570f70ac4dc0f5a8a4b58f513a1545)
Ansraer 4 년 전
부모
커밋
729a9c8a5e
3개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      editor/editor_node.cpp
  2. 4 0
      editor/editor_settings.cpp
  3. 4 0
      editor/project_manager.cpp

+ 4 - 0
editor/editor_node.cpp

@@ -5858,6 +5858,10 @@ EditorNode::EditorNode() {
 				if (OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).y >= 1400) {
 					// hiDPI display.
 					scale = 2.0;
+				} else if (OS::get_singleton()->get_screen_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 (OS::get_singleton()->get_screen_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.

+ 4 - 0
editor/editor_settings.cpp

@@ -328,6 +328,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
 	if (OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).y >= 1400) {
 		// hiDPI display.
 		scale = 2.0;
+	} else if (OS::get_singleton()->get_screen_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 (OS::get_singleton()->get_screen_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.

+ 4 - 0
editor/project_manager.cpp

@@ -2448,6 +2448,10 @@ ProjectManager::ProjectManager() {
 				if (OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).y >= 1400) {
 					// hiDPI display.
 					scale = 2.0;
+				} else if (OS::get_singleton()->get_screen_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 (OS::get_singleton()->get_screen_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.