You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Native pan and zoom for macOS
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user