Merge pull request #42670 from timothyqiu/state-machine-pan

Add pan gesture to AnimationTree's StateMachine editor
This commit is contained in:
Rémi Verschelde 2020-10-09 15:07:34 +02:00 committed by GitHub
commit 2e68a283bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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) {