From 919010235c4f36062876ce7974179384dd5f345e Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 27 Aug 2024 21:49:28 +0800 Subject: [PATCH] fix: (flutter) desktop gesture detector changes for new Gizmo methods --- .../gestures/thermion_gesture_detector_desktop.dart | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/thermion_flutter/thermion_flutter/lib/thermion/widgets/camera/gestures/thermion_gesture_detector_desktop.dart b/thermion_flutter/thermion_flutter/lib/thermion/widgets/camera/gestures/thermion_gesture_detector_desktop.dart index 45c7232a..4ab1e711 100644 --- a/thermion_flutter/thermion_flutter/lib/thermion/widgets/camera/gestures/thermion_gesture_detector_desktop.dart +++ b/thermion_flutter/thermion_flutter/lib/thermion/widgets/camera/gestures/thermion_gesture_detector_desktop.dart @@ -114,12 +114,7 @@ class _ThermionGestureDetectorDesktopState Widget build(BuildContext context) { return Listener( onPointerHover: (event) async { - // print( - // "local position ${event.localPosition} globalPosition ${event.position}");r _gizmo?.checkHover(event.localPosition.dx, event.localPosition.dy); - if (_gizmo == null || _gizmo!.isActive == true) { - return; - } }, onPointerSignal: (PointerSignalEvent pointerSignal) async { if (pointerSignal is PointerScrollEvent) { @@ -134,9 +129,6 @@ class _ThermionGestureDetectorDesktopState throw Exception("TODO - is this a pinch zoom on laptop trackpad?"); }, onPointerDown: (d) async { - if (_gizmo?.isActive == true) { - return; - } if (d.buttons != kTertiaryButton && widget.enablePicking) { widget.controller .pick(d.localPosition.dx.toInt(), d.localPosition.dy.toInt()); @@ -145,7 +137,7 @@ class _ThermionGestureDetectorDesktopState }, // holding/moving the left mouse button is interpreted as a pan, middle mouse button as a rotate onPointerMove: (PointerMoveEvent d) async { - if (_gizmo?.isActive == true) { + if (_gizmo?.isHovered == true) { _gizmo!.translate(d.delta.dx, d.delta.dy); return; } @@ -173,8 +165,7 @@ class _ThermionGestureDetectorDesktopState // 2) if _pointerMoving is false, this is interpreted as a pick // same applies to middle mouse button, but this is ignored as a pick onPointerUp: (PointerUpEvent d) async { - if (_gizmo?.isActive == true) { - _gizmo!.reset(); + if (_gizmo?.isHovered == true) { return; }