diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-04-05 23:00:56 -0600 |
---|---|---|
committer | Lightning_A <aaronjrecord@gmail.com> | 2021-04-05 23:00:56 -0600 |
commit | d5149497550b1267754464c4ec6ac58ed7293bb0 (patch) | |
tree | 885a8b9a5dacd438a504e9a77059e1e8adf655b9 /scene | |
parent | f4b82814f89d992bc0119245590737ae361a0358 (diff) |
Make scrollwheel zoom based on mouse position
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/graph_edit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 65046d5d10..06c9cf1b63 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1323,9 +1323,9 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { } if (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP && Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { - set_zoom(zoom * ZOOM_SCALE); + set_zoom_custom(zoom * ZOOM_SCALE, b->get_position()); } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { - set_zoom(zoom / ZOOM_SCALE); + set_zoom_custom(zoom / ZOOM_SCALE, b->get_position()); } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_UP && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8); } else if (b->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { |