From a25137c48ef43b1140516660048388845726109b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 15 Feb 2022 16:49:00 +0800 Subject: [PATCH] Utilize mouse position when zooming with shortcuts in 2D editor --- editor/plugins/canvas_item_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 25ed890ba23..40f2074a498 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4686,7 +4686,7 @@ void CanvasItemEditor::_button_zoom_plus() { } void CanvasItemEditor::_shortcut_zoom_set(float p_zoom) { - _zoom_on_position(p_zoom * MAX(1, EDSCALE), viewport_scrollable->get_size() / 2.0); + _zoom_on_position(p_zoom * MAX(1, EDSCALE), viewport->get_local_mouse_position()); } void CanvasItemEditor::_button_toggle_smart_snap(bool p_status) {