Skip to content

Commit

Permalink
Merge pull request #42670 from timothyqiu/state-machine-pan
Browse files Browse the repository at this point in the history
Add pan gesture to AnimationTree's StateMachine editor
  • Loading branch information
akien-mga authored Oct 9, 2020
2 parents e9ff086 + e9bec0d commit 2e68a28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editor/plugins/animation_state_machine_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2e68a28

Please sign in to comment.