mirror of
https://github.com/godotengine/godot
synced 2024-09-04 21:38:30 +00:00
Fixes Hint label in 2D editor appearing at wrong position and pushes zoom controls
This commit is contained in:
parent
e6caaf4c80
commit
9f01c887b1
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue