diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-11-21 13:03:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 13:03:32 +0100 |
commit | 5a23136d1bdc88589ee7082098dadf74afef53c2 (patch) | |
tree | 70f59ef74795849c2941db99d92ba61e36a5bf8a /modules | |
parent | ec4d467b4c5edac86af6aaab0545770377294346 (diff) | |
parent | 80ad8afc85a90e6fda1b136b13c1eb42e35c115e (diff) |
Merge pull request #12573 from poke1024/macostouchpad
Native pan and zoom for macOS + InputEventGesture
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 491adb31ee..3a5d0fd3fc 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -623,6 +623,16 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu return do_input_action(p_camera, mm->get_position(), false); } + Ref<InputEventPanGesture> pan_gesture = p_event; + if (pan_gesture.is_valid()) { + + if (pan_gesture->get_command() || pan_gesture->get_shift()) { + const real_t delta = pan_gesture->get_delta().y; + floor->set_value(floor->get_value() + SGN(delta)); + return true; + } + } + return false; } |