1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Native pan and zoom for macOS

This commit is contained in:
Bernhard Liebl
2017-11-01 21:49:39 +01:00
parent 5ff84070ca
commit 80ad8afc85
21 changed files with 549 additions and 133 deletions

View File

@@ -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;
}