diff options
author | Kyle <eichlinkyle@gmail.com> | 2021-03-26 21:27:43 -0400 |
---|---|---|
committer | Kyle <eichlinkyle@gmail.com> | 2021-03-26 21:27:43 -0400 |
commit | 918f50c04ce949c36dead1f219ade5fcffe62782 (patch) | |
tree | 70f1f207de01675ef25bdfebde932a94e374d0d2 /editor | |
parent | 166a6d0ba2d4055f7621e9aac4e3c095ca1cf9ba (diff) |
Fixes project manager window size scaling
This is a workaround fix for a Vector2i multiplication regression issue that prevents the project manager window size from scaling correctly. This calculates the new window size x and y values separately.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/project_manager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 914806039f..26ff8e1551 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2425,8 +2425,10 @@ ProjectManager::ProjectManager() { // Define a minimum window size to prevent UI elements from overlapping or being cut off DisplayServer::get_singleton()->window_set_min_size(Size2(750, 420) * EDSCALE); - // TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below - DisplayServer::get_singleton()->window_set_size(DisplayServer::get_singleton()->window_get_size() * MAX(1, EDSCALE)); + // TODO: Resize windows on hiDPI displays on Windows and Linux and remove the lines below + float scale_factor = MAX(1, EDSCALE); + Vector2i window_size = DisplayServer::get_singleton()->window_get_size(); + DisplayServer::get_singleton()->window_set_size(Vector2i(window_size.x * scale_factor, window_size.y * scale_factor)); } // TRANSLATORS: This refers to the application where users manage their Godot projects. |