fixed holding alt while zooming zooms in by 2 increments.

This commit is contained in:
MladoniSzabi 2022-10-12 14:56:36 +01:00
parent fd4572cc45
commit 3550354fd3
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {
Vector2 scroll_vec = Vector2((mb->get_button_index() == MouseButton::WHEEL_RIGHT) - (mb->get_button_index() == MouseButton::WHEEL_LEFT), (mb->get_button_index() == MouseButton::WHEEL_DOWN) - (mb->get_button_index() == MouseButton::WHEEL_UP));
if (scroll_vec != Vector2()) {
// Moving the scroll wheel sends two events: one with pressed as true,
// and one with pressed as false. Make sure we only process one of them.
if (scroll_vec != Vector2() && mb->is_pressed()) {
if (control_scheme == SCROLL_PANS) {
if (mb->is_ctrl_pressed()) {
scroll_vec.y *= mb->get_factor();