Add a fix to prevent the AnimationController from stopping if a sensor control is active.

This commit is contained in:
Nick Cellini 2021-09-15 10:28:41 +10:00
parent 7be49de63a
commit e71c64f98b

View file

@ -211,8 +211,12 @@ class _PanoramaState extends State<Panorama> with SingleTickerProviderStateMixin
zoomDelta *= 1 - _dampingFactor; zoomDelta *= 1 - _dampingFactor;
scene!.camera.zoom = zoom.clamp(widget.minZoom, widget.maxZoom); scene!.camera.zoom = zoom.clamp(widget.minZoom, widget.maxZoom);
// stop animation if not needed // stop animation if not needed
if (latitudeDelta.abs() < 0.001 && longitudeDelta.abs() < 0.001 && zoomDelta.abs() < 0.001) { if (latitudeDelta.abs() < 0.001 &&
if (widget.animSpeed == 0 && _controller.isAnimating) _controller.stop(); longitudeDelta.abs() < 0.001 &&
zoomDelta.abs() < 0.001) {
if (widget.sensorControl == SensorControl.None &&
widget.animSpeed == 0 &&
_controller.isAnimating) _controller.stop();
} }
// rotate for screen orientation // rotate for screen orientation