addHistory method

void addHistory({
  1. double? scaleRotation,
  2. double? angle,
})

Adds the current transformation to the history.

Implementation

void addHistory({double? scaleRotation, double? angle}) {
  if (!initialized) return;
  cleanForwardChanges();
  history.add(
    TransformConfigs(
      cropEditorScreenRatio: cropEditorScreenRatio,
      angle: angle ?? rotateAnimation.value,
      cropRect: cropRect,
      originalSize: originalSize,
      scaleUser: userScaleFactor,
      scaleRotation: scaleRotation ?? scaleAnimation.value,
      aspectRatio: aspectRatio,
      flipX: flipX,
      flipY: flipY,
      offset: translate,
    ),
  );
  screenshotHistoryPosition++;
  setState(() {});
  takeScreenshot();
}