calculateScaleRotate method

dynamic calculateScaleRotate({
  1. required ScaleUpdateDetails detail,
  2. required Layer activeLayer,
  3. required Size editorSize,
  4. required EdgeInsets screenPaddingHelper,
  5. required bool configEnabledHitVibration,
})

Calculates scaling and rotation of a layer based on user interactions.

Implementation

calculateScaleRotate({
  required ScaleUpdateDetails detail,
  required Layer activeLayer,
  required Size editorSize,
  required EdgeInsets screenPaddingHelper,
  required bool configEnabledHitVibration,
}) {
  _activeScale = true;

  activeLayer.scale = baseScaleFactor * detail.scale;
  activeLayer.rotation = baseAngleFactor + detail.rotation;

  checkRotationLine(
    activeLayer: activeLayer,
    editorSize: editorSize,
    configEnabledHitVibration: configEnabledHitVibration,
  );

  scaleDebounce(() => _activeScale = false);
}