summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-10-09 20:15:32 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-10-09 20:15:32 +0800
commite9bec0d76b042fe91262f42bbee876916925905e (patch)
treea20e19d00efa915c86706c5e3b0ad69e150748f9
parentcb9bf98bbac5aa0021a737c6003312a8d3de59b9 (diff)
Adds pan gesture to StateMachine editor
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 26006d85c9..885ec17cb3 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -386,6 +386,12 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
over_text = over_text_now;
}
}
+
+ Ref<InputEventPanGesture> pan_gesture = p_event;
+ if (pan_gesture.is_valid()) {
+ h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * pan_gesture->get_delta().x / 8);
+ v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * pan_gesture->get_delta().y / 8);
+ }
}
void AnimationNodeStateMachineEditor::_file_opened(const String &p_file) {