mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Native pan and zoom for macOS
This commit is contained in:
parent
5ff84070ca
commit
80ad8afc85
21 changed files with 549 additions and 133 deletions
|
|
@ -339,6 +339,19 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
|
|||
uv_edit_draw->update();
|
||||
}
|
||||
}
|
||||
|
||||
Ref<InputEventMagnifyGesture> magnify_gesture = p_input;
|
||||
if (magnify_gesture.is_valid()) {
|
||||
|
||||
uv_zoom->set_value(uv_zoom->get_value() * magnify_gesture->get_factor());
|
||||
}
|
||||
|
||||
Ref<InputEventPanGesture> pan_gesture = p_input;
|
||||
if (pan_gesture.is_valid()) {
|
||||
|
||||
uv_hscroll->set_value(uv_hscroll->get_value() + uv_hscroll->get_page() * pan_gesture->get_delta().x / 8);
|
||||
uv_vscroll->set_value(uv_vscroll->get_value() + uv_vscroll->get_page() * pan_gesture->get_delta().y / 8);
|
||||
}
|
||||
}
|
||||
|
||||
void Polygon2DEditor::_uv_scroll_changed(float) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue