reinstate desktop gesture recognizer

This commit is contained in:
Nick Fisher
2023-07-18 11:32:33 +08:00
parent 85c3e03cf0
commit 42557401fe

View File

@@ -99,40 +99,37 @@ class _FilamentGestureDetectorState extends State<FilamentGestureDetector> {
}); });
} }
}, },
onPointerPanZoomStart: !widget.enableControls onPointerPanZoomStart: !widget.enableControls ? null : (pzs) {},
? null
: (pzs) {
print("PAN ZOOM START");
},
onPointerDown: !widget.enableControls onPointerDown: !widget.enableControls
? null ? null
: (d) async { : (d) async {
print("a"); if (d.buttons == kTertiaryButton || _rotating) {
// if (d.buttons == kTertiaryButton || _rotating) { widget.controller
// widget.controller .rotateStart(d.localPosition.dx, d.localPosition.dy);
// .rotateStart(d.localPosition.dx, d.localPosition.dy); } else {
// } else { widget.controller
// widget.controller.panStart(d.focalPoint.dx, d.focalPoint.dy); .panStart(d.localPosition.dx, d.localPosition.dy);
// } }
}, },
onPointerMove: !widget.enableControls onPointerMove: !widget.enableControls
? null ? null
: (PointerMoveEvent d) async { : (PointerMoveEvent d) async {
// if (d.buttons == kTertiaryButton || _rotating) { if (d.buttons == kTertiaryButton || _rotating) {
// widget.controller widget.controller
// .rotateUpdate(d.localPosition.dx, d.localPosition.dy); .rotateUpdate(d.localPosition.dx, d.localPosition.dy);
// } else { } else {
// widget.controller.panUpdate(d.focalPoint.dx, d.focalPoint.dy); widget.controller
// } .panUpdate(d.localPosition.dx, d.localPosition.dy);
}
}, },
onPointerUp: !widget.enableControls onPointerUp: !widget.enableControls
? null ? null
: (d) async { : (d) async {
// if (d.buttons == kTertiaryButton || _rotating) { if (d.buttons == kTertiaryButton || _rotating) {
// widget.controller.rotateEnd(); widget.controller.rotateEnd();
// } else { } else {
// widget.controller.panEnd(d.focalPoint.dx, d.focalPoint.dy); widget.controller.panEnd();
// } }
}, },
child: widget.child); child: widget.child);
} }
@@ -145,7 +142,6 @@ class _FilamentGestureDetectorState extends State<FilamentGestureDetector> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onDoubleTap: () { onDoubleTap: () {
_rotating = !_rotating; _rotating = !_rotating;
print("Set rotating to $_rotating");
}, },
onScaleStart: !widget.enableControls onScaleStart: !widget.enableControls
? null ? null