summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBernhard Liebl <Bernhard.Liebl@gmx.org>2017-11-01 21:49:39 +0100
committerBernhard Liebl <Bernhard.Liebl@gmx.org>2017-11-21 09:11:39 +0100
commit80ad8afc85a90e6fda1b136b13c1eb42e35c115e (patch)
treebc145bc5c008a2abfa159f4d5437c8d0b8813aca /modules
parent5ff84070ca3604b43e86562a3d000ed924a604a2 (diff)
Native pan and zoom for macOS
Diffstat (limited to 'modules')
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp10
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;
}