Utilize mouse position when zooming with shortcuts in 2D editor

This commit is contained in:
Haoyu Qiu 2022-02-15 16:49:00 +08:00
parent 869939c09f
commit a25137c48e

View File

@ -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) {