Native pan and zoom for macOS
This commit is contained in:
parent
5ff84070ca
commit
80ad8afc85
21 changed files with 549 additions and 133 deletions
|
|
@ -2889,6 +2889,18 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ref<InputEventMagnifyGesture> magnify_gesture = p_input;
|
||||
if (magnify_gesture.is_valid()) {
|
||||
zoom->set_value(zoom->get_value() * magnify_gesture->get_factor());
|
||||
}
|
||||
|
||||
Ref<InputEventPanGesture> pan_gesture = p_input;
|
||||
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 AnimationKeyEditor::_notification(int p_what) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue