onScaleStart method
Implementation
void onScaleStart(ScaleStartDetails details) {
// 优先处理文本拖动
final selectedId = _textLayerManager.selectLayerAt(
details.localFocalPoint,
_canvasSize ?? Size.zero,
);
if (selectedId != null) {
_dragTextStartPoint = details.localFocalPoint;
final selectedLayer = _textLayerManager.selectedLayer;
if (selectedLayer != null) {
_initialLayerOffset = selectedLayer.position;
}
notifyListeners();
return; // 命中文字,中断后续操作
}
if (isCroppingActive) {
_onCropDragStart(details.localFocalPoint);
} else {
_previousScale = _scale;
// 初始化时,假设不是缩放手势,后续根据 scale 值判断
_isScalingGesture = false;
}
}