From f107139979d55eaa2f3ddc41f2c7d7895801f2e5 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Wed, 31 Mar 2021 12:50:24 +0100 Subject: Rename Project Window width and height settings to match their function --- editor/editor_run.cpp | 18 +++++++++--------- editor/plugins/canvas_item_editor_plugin.cpp | 4 ++-- editor/plugins/node_3d_editor_plugin.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'editor') diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 3c1799d80c..574abf85ea 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -98,15 +98,15 @@ Error EditorRun::run(const String &p_scene) { screen_rect.position = DisplayServer::get_singleton()->screen_get_position(screen); screen_rect.size = DisplayServer::get_singleton()->screen_get_size(screen); + Size2 window_size; + window_size.x = ProjectSettings::get_singleton()->get("display/window/size/viewport_width"); + window_size.y = ProjectSettings::get_singleton()->get("display/window/size/viewport_height"); + Size2 desired_size; - desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width"); - desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/height"); - - Size2 test_size; - test_size.x = ProjectSettings::get_singleton()->get("display/window/size/test_width"); - test_size.y = ProjectSettings::get_singleton()->get("display/window/size/test_height"); - if (test_size.x > 0 && test_size.y > 0) { - desired_size = test_size; + desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/window_width_override"); + desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/window_height_override"); + if (desired_size.x > 0 && desired_size.y > 0) { + window_size = desired_size; } int window_placement = EditorSettings::get_singleton()->get("run/window_placement/rect"); @@ -136,7 +136,7 @@ Error EditorRun::run(const String &p_scene) { args.push_back(itos(screen_rect.position.x) + "," + itos(screen_rect.position.y)); } break; case 1: { // centered - Vector2 pos = (screen_rect.position) + ((screen_rect.size - desired_size) / 2).floor(); + Vector2 pos = (screen_rect.position) + ((screen_rect.size - window_size) / 2).floor(); args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); } break; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d6fd153665..6ce42e1386 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3508,7 +3508,7 @@ void CanvasItemEditor::_draw_axis() { Color area_axis_color = EditorSettings::get_singleton()->get("editors/2d/viewport_border_color"); - Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")); + Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); Vector2 screen_endpoints[4] = { transform.xform(Vector2(0, 0)), @@ -4001,7 +4001,7 @@ void CanvasItemEditor::_update_scrollbars() { Size2 vmin = v_scroll->get_minimum_size(); // Get the visible frame. - Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")); + Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height)); // Calculate scrollable area. diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 1a466d4046..d3f2cc0807 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3061,7 +3061,7 @@ void Node3DEditorViewport::_draw() { Math::round(2 * EDSCALE)); } if (previewing) { - Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")); + Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); float aspect = ss.aspect(); Size2 s = get_size(); -- cgit v1.2.3