diff options
author | Eric McGuirk <mcguirk.eric@gmail.com> | 2022-01-27 00:07:54 -0500 |
---|---|---|
committer | Eric McGuirk <mcguirk.eric@gmail.com> | 2022-01-27 21:49:33 -0500 |
commit | 9f01c887b11959f2bc7447ed3051b357c20c0c7f (patch) | |
tree | f5e4de82895b0882b9f8f77beb5f764e72b244b6 | |
parent | e6caaf4c800912517af783e90519cc2a70001e85 (diff) |
Fixes Hint label in 2D editor appearing at wrong position and pushes zoom controls
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index e9b0b30ceb..dff01cbf05 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. |