Skip to content

Commit

Permalink
remove MultiFingerGesture
Browse files Browse the repository at this point in the history
non breaking commit
  • Loading branch information
josxha committed Nov 22, 2023
1 parent b9f9943 commit d32fcff
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 47 deletions.
1 change: 0 additions & 1 deletion lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export 'package:flutter_map/src/geo/latlng_bounds.dart';
export 'package:flutter_map/src/gestures/interactive_flag.dart';
export 'package:flutter_map/src/gestures/latlng_tween.dart';
export 'package:flutter_map/src/gestures/map_events.dart';
export 'package:flutter_map/src/gestures/multi_finger_gesture.dart';
export 'package:flutter_map/src/gestures/tap_position.dart';
export 'package:flutter_map/src/layer/attribution_layer/rich/animation.dart';
export 'package:flutter_map/src/layer/attribution_layer/rich/source.dart';
Expand Down
10 changes: 9 additions & 1 deletion lib/src/gestures/interactive_flag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ abstract class InteractiveFlag {
doubleTapZoom |
doubleTapDragZoom |
scrollWheelZoom |
rotate;
rotate |
ctrlDragRotate;

static const int none = 0;

Expand Down Expand Up @@ -54,6 +55,10 @@ abstract class InteractiveFlag {
/// [InteractionOptions.cursorKeyboardRotationOptions].
static const int rotate = 1 << 7;

/// Enable rotation by pressing the CTRL Key and drag the map with the cursor.
/// To change the key see [InteractionOptions.cursorKeyboardRotationOptions].
static const int ctrlDragRotate = 1 << 8;

/// Flags pertaining to gestures which require multiple fingers.
static const _multiFingerFlags = pinchMove | pinchZoom | rotate;

Expand Down Expand Up @@ -93,4 +98,7 @@ abstract class InteractiveFlag {

/// True if the [scrollWheelZoom] interactive flag is enabled.
static bool hasScrollWheelZoom(int flags) => hasFlag(flags, scrollWheelZoom);

/// True if the [ctrlDragRotate] interactive flag is enabled.
static bool hasCtrlDragRotate(int flags) => hasFlag(flags, ctrlDragRotate);
}
38 changes: 0 additions & 38 deletions lib/src/gestures/multi_finger_gesture.dart

This file was deleted.

7 changes: 3 additions & 4 deletions lib/src/map/options/interaction.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter_map/src/gestures/interactive_flag.dart';
import 'package:flutter_map/src/gestures/multi_finger_gesture.dart';
import 'package:flutter_map/src/map/options/cursor_keyboard_rotation.dart';
import 'package:meta/meta.dart';

Expand Down Expand Up @@ -87,13 +86,13 @@ final class InteractionOptions {
this.debugMultiFingerGestureWinner = false,
this.enableMultiFingerGestureRace = false,
this.rotationThreshold = 20.0,
this.rotationWinGestures = MultiFingerGesture.rotate,
this.rotationWinGestures = InteractiveFlag.rotate,
this.pinchZoomThreshold = 0.5,
this.pinchZoomWinGestures =
MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
InteractiveFlag.pinchZoom | InteractiveFlag.pinchMove,
this.pinchMoveThreshold = 40.0,
this.pinchMoveWinGestures =
MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
InteractiveFlag.pinchZoom | InteractiveFlag.pinchMove,
this.enableScrollWheel = false,
this.scrollWheelVelocity = 0.005,
this.cursorKeyboardRotationOptions = const CursorKeyboardRotationOptions(),
Expand Down
6 changes: 3 additions & 3 deletions lib/src/map/options/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ class MapOptions {
debugMultiFingerGestureWinner: _debugMultiFingerGestureWinner ?? false,
enableMultiFingerGestureRace: _enableMultiFingerGestureRace ?? false,
rotationThreshold: _rotationThreshold ?? 20.0,
rotationWinGestures: _rotationWinGestures ?? MultiFingerGesture.rotate,
rotationWinGestures: _rotationWinGestures ?? InteractiveFlag.rotate,
pinchZoomThreshold: _pinchZoomThreshold ?? 0.5,
pinchZoomWinGestures: _pinchZoomWinGestures ??
MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
InteractiveFlag.pinchZoom | InteractiveFlag.pinchMove,
pinchMoveThreshold: _pinchMoveThreshold ?? 40.0,
pinchMoveWinGestures: _pinchMoveWinGestures ??
MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
InteractiveFlag.pinchZoom | InteractiveFlag.pinchMove,
enableScrollWheel: _enableScrollWheel ?? true,
scrollWheelVelocity: _scrollWheelVelocity ?? 0.005,
);
Expand Down

0 comments on commit d32fcff

Please sign in to comment.