This commit is contained in:
李志鹏
2026-01-14 14:43:43 +08:00
parent e42975159f
commit 810dd2351b
6 changed files with 1008 additions and 27 deletions

View File

@@ -190,30 +190,26 @@ export class ToolManager {
[OperationType.PART]: {
name: "部件选取工具",
icon: "part",
cursor: "crosshair",
// setup: this.setupLassoTool.bind(this),
specialLayerDisabled: true,
cursor: "default",
setup: this.setupPartTool.bind(this),
},
[OperationType.PART_RECTANGLE]: {
name: "部件选取工具-矩形",
icon: "part",
cursor: "crosshair",
// setup: this.setupRectangleLassoTool.bind(this),
specialLayerDisabled: true,
cursor: "default",
setup: this.setupPartTool.bind(this),
},
[OperationType.PART_BRUSH]: {
name: "部件选取工具-画笔",
icon: "part",
cursor: "crosshair",
// setup: this.setupEllipseLassoTool.bind(this),
specialLayerDisabled: true,
cursor: "default",
setup: this.setupPartTool.bind(this),
},
[OperationType.PART_ERASER]: {
name: "部件选取工具-橡皮擦",
icon: "part",
cursor: "crosshair",
// setup: this.setupEllipseLassoTool.bind(this),
specialLayerDisabled: true,
cursor: "default",
setup: this.setupPartTool.bind(this),
},
// 红绿图模式专用工具
@@ -704,6 +700,20 @@ export class ToolManager {
}
}
/**
* 设置部件选取工具
*/
setupPartTool() {
if (!this.canvas) return;
if (this.checkToolCanOperateSelectedObject()) return;
this.canvas.isDrawingMode = false;
this.canvas.selection = false;
if (this.canvasManager && this.canvasManager.partManager) {
this.canvasManager.partManager.setCurrentTool(OperationType.PART);
}
}
/**
* 设置波浪工具
*/