feat: 裁剪组裁剪跟随选择组移动
This commit is contained in:
@@ -110,9 +110,7 @@ export class AddToSelectionCommand extends Command {
|
||||
}
|
||||
|
||||
// 添加到选区
|
||||
const result = await this.selectionManager.addToSelection(
|
||||
this.newSelection
|
||||
);
|
||||
const result = await this.selectionManager.addToSelection(this.newSelection);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -155,9 +153,7 @@ export class RemoveFromSelectionCommand extends Command {
|
||||
}
|
||||
|
||||
// 从选区中移除
|
||||
const result = await this.selectionManager.removeFromSelection(
|
||||
this.removeSelection
|
||||
);
|
||||
const result = await this.selectionManager.removeFromSelection(this.removeSelection);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -203,9 +199,7 @@ export class FeatherSelectionCommand extends Command {
|
||||
}
|
||||
|
||||
// 应用羽化
|
||||
const result = await this.selectionManager.featherSelection(
|
||||
this.featherAmount
|
||||
);
|
||||
const result = await this.selectionManager.featherSelection(this.featherAmount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -347,8 +341,7 @@ export class CopySelectionToNewLayerCommand extends CompositeCommand {
|
||||
}
|
||||
|
||||
// 确定源图层
|
||||
const sourceId =
|
||||
this.sourceLayerId || this.layerManager.getActiveLayerId();
|
||||
const sourceId = this.sourceLayerId || this.layerManager.getActiveLayerId();
|
||||
const sourceLayer = this.layerManager.getLayerById(sourceId);
|
||||
if (!sourceLayer || !sourceLayer.fabricObjects) {
|
||||
console.error("无法复制选区:源图层无效或为空");
|
||||
@@ -356,10 +349,7 @@ export class CopySelectionToNewLayerCommand extends CompositeCommand {
|
||||
}
|
||||
|
||||
// 创建新图层
|
||||
this.newLayerId = await this.layerManager.createLayer(
|
||||
this.newLayerName,
|
||||
LayerType.EMPTY
|
||||
);
|
||||
this.newLayerId = await this.layerManager.createLayer(this.newLayerName, LayerType.EMPTY);
|
||||
|
||||
// 获取选区内的对象
|
||||
const objectsToCopy = sourceLayer.fabricObjects.filter((obj) => {
|
||||
|
||||
Reference in New Issue
Block a user