Native pan and zoom for macOS
This commit is contained in:
parent
5ff84070ca
commit
80ad8afc85
21 changed files with 549 additions and 133 deletions
|
|
@ -180,6 +180,17 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
time_since_motion = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Ref<InputEventPanGesture> pan_gesture = p_gui_input;
|
||||
if (pan_gesture.is_valid()) {
|
||||
|
||||
if (h_scroll->is_visible_in_tree()) {
|
||||
h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * pan_gesture->get_delta().x / 8);
|
||||
}
|
||||
if (v_scroll->is_visible_in_tree()) {
|
||||
v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * pan_gesture->get_delta().y / 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollContainer::_update_scrollbar_position() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue