From e71c64f98b2cc7419115b2105048fcf0a28eba45 Mon Sep 17 00:00:00 2001 From: Nick Cellini Date: Wed, 15 Sep 2021 10:28:41 +1000 Subject: [PATCH] Add a fix to prevent the AnimationController from stopping if a sensor control is active. --- lib/panorama.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/panorama.dart b/lib/panorama.dart index 5678acc..044cfc9 100644 --- a/lib/panorama.dart +++ b/lib/panorama.dart @@ -211,8 +211,12 @@ class _PanoramaState extends State with SingleTickerProviderStateMixin zoomDelta *= 1 - _dampingFactor; scene!.camera.zoom = zoom.clamp(widget.minZoom, widget.maxZoom); // stop animation if not needed - if (latitudeDelta.abs() < 0.001 && longitudeDelta.abs() < 0.001 && zoomDelta.abs() < 0.001) { - if (widget.animSpeed == 0 && _controller.isAnimating) _controller.stop(); + if (latitudeDelta.abs() < 0.001 && + longitudeDelta.abs() < 0.001 && + zoomDelta.abs() < 0.001) { + if (widget.sensorControl == SensorControl.None && + widget.animSpeed == 0 && + _controller.isAnimating) _controller.stop(); } // rotate for screen orientation