部件选取
This commit is contained in:
@@ -178,7 +178,7 @@ export class CanvasManager {
|
||||
this.canvas.onBrushImageConverted = async (fabricImage) => {
|
||||
const activeTool = this.toolManager?.activeTool?.value;
|
||||
if(activeTool === OperationType.PART_BRUSH){
|
||||
this.partManager?.addPartImage(fabricImage);
|
||||
this.partManager?.addDrawPartImage(fabricImage);
|
||||
}else{
|
||||
await this.addImageToLayer({ fabricImage, targetLayerId: null });
|
||||
}
|
||||
@@ -203,6 +203,10 @@ export class CanvasManager {
|
||||
console.log("擦除完成", e.targets);
|
||||
// 可以在这里保存状态到命令管理器
|
||||
const affectedObjects = e.targets || [];
|
||||
const activeTool = this.toolManager?.activeTool?.value;
|
||||
if(activeTool === OperationType.PART_ERASER){
|
||||
return this.partManager?.onErasingEnd(affectedObjects);
|
||||
}
|
||||
const command = this.eraserStateManager.endErasing(affectedObjects);
|
||||
if (command && this.commandManager) {
|
||||
await this.commandManager?.executeCommand?.(command);
|
||||
|
||||
Reference in New Issue
Block a user