部件选取框选工具合并操作
This commit is contained in:
@@ -90,16 +90,17 @@ export class PartManager {
|
||||
|
||||
if (toolId === OperationType.PART_ERASER) {
|
||||
this.setEraserTool();
|
||||
} else if (toolId === OperationType.PART || toolId === OperationType.PART_RECTANGLE) {
|
||||
this.clearPointData();
|
||||
this.resetPartObject();
|
||||
}
|
||||
if (toolId === OperationType.PART_ERASER || toolId === OperationType.PART_BRUSH) {
|
||||
if (this.pointList.length > 0) {
|
||||
this.clearPointData();
|
||||
this.resetPartObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
// else if (toolId === OperationType.PART || toolId === OperationType.PART_RECTANGLE) {
|
||||
// this.clearPointData();
|
||||
// this.resetPartObject();
|
||||
// }
|
||||
// if (toolId === OperationType.PART_ERASER || toolId === OperationType.PART_BRUSH) {
|
||||
// if (this.pointList.length > 0) {
|
||||
// this.clearPointData();
|
||||
// this.resetPartObject();
|
||||
// }
|
||||
// }
|
||||
|
||||
// 如果从非选区工具切换到选区工具,初始化事件
|
||||
if (!wasActive && this.isActive) {
|
||||
@@ -380,7 +381,8 @@ export class PartManager {
|
||||
box: [...this.pointList],
|
||||
});
|
||||
const image = await this.loadImageToObject(url);
|
||||
const canvas = getObjectAlphaToCanvas(image, null, 0, this.rgba);
|
||||
const data = this.partCanvas?.getContext("2d")?.getImageData(0, 0, this.partCanvas.width, this.partCanvas.height);
|
||||
const canvas = getObjectAlphaToCanvas(image, data, 0, this.rgba, !!data);
|
||||
this.partDrawCommand(canvas);
|
||||
}
|
||||
/** 获取分隔后图片 */
|
||||
|
||||
Reference in New Issue
Block a user