flame icon indicating copy to clipboard operation
flame copied to clipboard

Add support for trackpad gestures

Open keithjohnston opened this issue 2 years ago • 1 comments

Problem to solve

Flutter recently added trackpad gestures: https://docs.flutter.dev/release/breaking-changes/trackpad-gestures Scrolling with two fingers on a trackpad does not work on mac osx

Proposal

This fix allows you to detect two finger scrolling See PR https://github.com/keithjohnston/flame/pull/1

More information

Example usage:

@override
 void onPointerPanZoom(PointerPanZoomUpdateInfo info) {
    cameraComponent.viewfinder.zoom = clampZoom(cameraComponent.viewfinder.zoom +
        info.scrollDelta.game.y.sign * zoomPerScrollUnit);
  }

keithjohnston avatar Jul 30 '23 17:07 keithjohnston

Hi, can you please add your PR to the Flame repo instead of your clone. :)

spydon avatar Aug 07 '23 12:08 spydon