From 9f01c887b11959f2bc7447ed3051b357c20c0c7f Mon Sep 17 00:00:00 2001 From: Eric McGuirk Date: Thu, 27 Jan 2022 00:07:54 -0500 Subject: [PATCH] Fixes Hint label in 2D editor appearing at wrong position and pushes zoom controls --- editor/plugins/canvas_item_editor_plugin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index e9b0b30ceb1..dff01cbf05f 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5231,6 +5231,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { controls_vb = memnew(VBoxContainer); controls_vb->set_begin(Point2(5, 5)); + zoom_widget = memnew(EditorZoomWidget); + controls_vb->add_child(zoom_widget); + zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE); + zoom_widget->connect("zoom_changed", callable_mp(this, &CanvasItemEditor::_update_zoom)); + panner.instantiate(); panner->set_callbacks(callable_mp(this, &CanvasItemEditor::_scroll_callback), callable_mp(this, &CanvasItemEditor::_pan_callback), callable_mp(this, &CanvasItemEditor::_zoom_callback)); @@ -5256,11 +5261,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport->add_child(controls_vb); - zoom_widget = memnew(EditorZoomWidget); - controls_vb->add_child(zoom_widget); - zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE); - zoom_widget->connect("zoom_changed", callable_mp(this, &CanvasItemEditor::_update_zoom)); - updating_scroll = false; // Add some margin to the left for better aesthetics.