From 80ad8afc85a90e6fda1b136b13c1eb42e35c115e Mon Sep 17 00:00:00 2001 From: Bernhard Liebl Date: Wed, 1 Nov 2017 21:49:39 +0100 Subject: Native pan and zoom for macOS --- modules/gridmap/grid_map_editor_plugin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules') 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 Refget_position(), false); } + Ref 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; } -- cgit v1.2.3