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 23, 2023
1 parent df206bb commit d5d3259
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 43 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.

5 changes: 2 additions & 3 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 @@ -80,10 +79,10 @@ 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,
Expand Down

0 comments on commit d5d3259

Please sign in to comment.