feat: 优化选区编辑+修复部分bug
This commit is contained in:
@@ -156,11 +156,18 @@ export class LassoCutoutCommand extends CompositeCommand {
|
||||
selectLayer.fabricObjects = [
|
||||
this.fabricImage.toObject("id", "layerId", "layerName", "parentId"),
|
||||
];
|
||||
this.groupLayer.clippingMask = this.fabricImage.toObject(
|
||||
"id",
|
||||
"layerId",
|
||||
"layerName",
|
||||
"parentId"
|
||||
); // 设置组图层的fabricObject为遮罩图像
|
||||
|
||||
this.groupLayer.children.push(selectLayer);
|
||||
// 插入新组图层
|
||||
this.layerManager.layers.value.splice(topLayerIndex, 1, this.groupLayer);
|
||||
|
||||
this.layerManager.updateLayersObjectsInteractivity();
|
||||
await this.layerManager.updateLayersObjectsInteractivity();
|
||||
this.canvas.discardActiveObject();
|
||||
this.canvas.setActiveObject(this.fabricImage);
|
||||
this.canvas.renderAll();
|
||||
|
||||
Reference in New Issue
Block a user