updateAspectRatio method
Updates the current aspect ratio with a new value and adds a new history entry.
This method performs the following steps:
- Resets the editor state while skipping the addition of a history entry.
- Updates the aspect ratio to the provided value.
- Triggers any necessary callbacks related to the new aspect ratio.
- Recalculates the crop rectangle and fits it to the screen.
- Adds a new history entry with the current scale factor and a rotation angle of zero.
- Updates all relevant states in the editor.
Implementation
void updateAspectRatio(double value) {
reset(skipAddHistory: true);
aspectRatio = value;
cropRotateEditorCallbacks?.handleRatioSelected(value);
calcCropRect();
calcFitToScreen();
addHistory(scaleRotation: oldScaleFactor, angle: 0);
_updateAllStates();
}