fix: (flutter) desktop gesture detector changes for new Gizmo methods
This commit is contained in:
@@ -114,12 +114,7 @@ class _ThermionGestureDetectorDesktopState
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Listener(
|
return Listener(
|
||||||
onPointerHover: (event) async {
|
onPointerHover: (event) async {
|
||||||
// print(
|
|
||||||
// "local position ${event.localPosition} globalPosition ${event.position}");r
|
|
||||||
_gizmo?.checkHover(event.localPosition.dx, event.localPosition.dy);
|
_gizmo?.checkHover(event.localPosition.dx, event.localPosition.dy);
|
||||||
if (_gizmo == null || _gizmo!.isActive == true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onPointerSignal: (PointerSignalEvent pointerSignal) async {
|
onPointerSignal: (PointerSignalEvent pointerSignal) async {
|
||||||
if (pointerSignal is PointerScrollEvent) {
|
if (pointerSignal is PointerScrollEvent) {
|
||||||
@@ -134,9 +129,6 @@ class _ThermionGestureDetectorDesktopState
|
|||||||
throw Exception("TODO - is this a pinch zoom on laptop trackpad?");
|
throw Exception("TODO - is this a pinch zoom on laptop trackpad?");
|
||||||
},
|
},
|
||||||
onPointerDown: (d) async {
|
onPointerDown: (d) async {
|
||||||
if (_gizmo?.isActive == true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (d.buttons != kTertiaryButton && widget.enablePicking) {
|
if (d.buttons != kTertiaryButton && widget.enablePicking) {
|
||||||
widget.controller
|
widget.controller
|
||||||
.pick(d.localPosition.dx.toInt(), d.localPosition.dy.toInt());
|
.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
|
// holding/moving the left mouse button is interpreted as a pan, middle mouse button as a rotate
|
||||||
onPointerMove: (PointerMoveEvent d) async {
|
onPointerMove: (PointerMoveEvent d) async {
|
||||||
if (_gizmo?.isActive == true) {
|
if (_gizmo?.isHovered == true) {
|
||||||
_gizmo!.translate(d.delta.dx, d.delta.dy);
|
_gizmo!.translate(d.delta.dx, d.delta.dy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -173,8 +165,7 @@ class _ThermionGestureDetectorDesktopState
|
|||||||
// 2) if _pointerMoving is false, this is interpreted as a pick
|
// 2) if _pointerMoving is false, this is interpreted as a pick
|
||||||
// same applies to middle mouse button, but this is ignored as a pick
|
// same applies to middle mouse button, but this is ignored as a pick
|
||||||
onPointerUp: (PointerUpEvent d) async {
|
onPointerUp: (PointerUpEvent d) async {
|
||||||
if (_gizmo?.isActive == true) {
|
if (_gizmo?.isHovered == true) {
|
||||||
_gizmo!.reset();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user