Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: prevent double-tap-drag zoom gesture emitting a tap event #1799

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/src/gestures/map_interactive_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class MapInteractiveViewerState extends State<MapInteractiveViewer>
var _pinchZoomStarted = false;
var _pinchMoveStarted = false;
var _dragStarted = false;
var _doubleTapDragZoomStarted = false;
var _flingAnimationStarted = false;

/// Helps to reset ScaleUpdateDetails.scale back to 1.0 when a multi finger
Expand Down Expand Up @@ -691,7 +690,6 @@ class MapInteractiveViewerState extends State<MapInteractiveViewer>

void _handleScaleEnd(ScaleEndDetails details) {
_resetDoubleTapHold();
_doubleTapDragZoomStarted = false;

final eventSource =
_dragMode ? MapEventSource.dragEnd : MapEventSource.multiFingerEnd;
Expand Down Expand Up @@ -749,11 +747,6 @@ class MapInteractiveViewerState extends State<MapInteractiveViewer>
final relativePosition = position.relative;
if (relativePosition == null) return;

// Prevent the onTap event from being registered if any drag is already
// happening. For example, when a double-tap-drag-zoom gesture starts, this
// prevents registering an onTap event as well.
if (_doubleTapDragZoomStarted) return;

widget.controller.tapped(
MapEventSource.tap,
position,
Expand Down Expand Up @@ -854,7 +847,6 @@ class MapInteractiveViewerState extends State<MapInteractiveViewer>

final flags = _interactionOptions.flags;
if (InteractiveFlag.hasDoubleTapDragZoom(flags)) {
_doubleTapDragZoomStarted = true;
final verticalOffset = (_focalStartLocal - details.localFocalPoint).dy;
final newZoom = _mapZoomStart - verticalOffset / 360 * _camera.zoom;

Expand Down