calculateScaleRotate method

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

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

Implementation

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

  activeLayer.scale = baseScaleFactor * detail.scale;
  _setMinMaxScaleFactor(configs, activeLayer);
  activeLayer.rotation = baseAngleFactor + detail.rotation;

  if (editorScaleFactor == 1) {
    checkRotationLine(
      activeLayer: activeLayer,
      editorSize: editorSize,
      configEnabledHitVibration: configEnabledHitVibration,
    );
  }

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