resetRotation method

void resetRotation()

Spring the rotation back to 0, re-covering the crop at the zoom the dial holds (rotationScaleFloor) rather than at the widest coverage the rotation passed through. imageTransform snaps; the visible rotation springs there over kTgSpring.

Implementation

void resetRotation() {
  if (imageTransform.totalRotate == 0) return;
  final preRender = _renderTransform.clone();
  _suppressMirror = true;
  rotateCovered(0, scaleFloor: rotationScaleFloor);
  _suppressMirror = false;
  _renderTransform.update(preRender);
  rotationScaleFloor = null;
  _spin(
    imageTransform.clone(),
    duration: kTgSpring,
    curve: const TgSpringCurve(),
  ).unawaited();
}