summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-09 15:07:34 +0200
committerGitHub <noreply@github.com>2020-10-09 15:07:34 +0200
commit2e68a283bc92fe49dc109c06a5400ed52dee657f (patch)
tree57862e6b99a6f4f3d526930f6c12f87e99df3f4d
parente9ff08692cc03d87e8b3dcc427de87899e5d50a5 (diff)
parente9bec0d76b042fe91262f42bbee876916925905e (diff)
Merge pull request #42670 from timothyqiu/state-machine-pan
Add pan gesture to AnimationTree's 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) {