画布增加的新功能
This commit is contained in:
@@ -46,13 +46,13 @@ export class RasterizeLayerCommand extends Command {
|
||||
this.layerId
|
||||
);
|
||||
this.layer = layer;
|
||||
this.parentLayer = parent;
|
||||
// this.parentLayer = parent;
|
||||
|
||||
// 新增:如果有父图层,则栅格化父图层及其所有子图层
|
||||
if (this.parentLayer) {
|
||||
this.layer = this.parentLayer;
|
||||
this.layerId = this.parentLayer.id;
|
||||
}
|
||||
// // 新增:如果有父图层,则栅格化父图层及其所有子图层
|
||||
// if (this.parentLayer) {
|
||||
// this.layer = this.parentLayer;
|
||||
// this.layerId = this.parentLayer.id;
|
||||
// }
|
||||
|
||||
this.isGroupLayer = this.layer?.children && this.layer.children.length > 0;
|
||||
|
||||
@@ -153,7 +153,7 @@ export class RasterizeLayerCommand extends Command {
|
||||
});
|
||||
|
||||
// 恢复原始图层结构
|
||||
this.layers.value = [...this.originalLayerStructure];
|
||||
this.layers.value = JSON.parse(this.originalLayerStructure);
|
||||
|
||||
// 恢复原活动图层
|
||||
this.activeLayerId.value = this.layerId;
|
||||
@@ -191,7 +191,7 @@ export class RasterizeLayerCommand extends Command {
|
||||
*/
|
||||
_saveOriginalLayerStructure() {
|
||||
// 只保存相关的图层结构,而不是整个图层数组
|
||||
this.originalLayerStructure = JSON.parse(JSON.stringify(this.layers.value));
|
||||
this.originalLayerStructure = JSON.stringify(this.layers.value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -517,12 +517,12 @@ export class ExportLayerToImageCommand extends Command {
|
||||
this.canvas
|
||||
);
|
||||
|
||||
clippingMaskFabricObject.clipPath = null;
|
||||
// clippingMaskFabricObject.clipPath = null;
|
||||
clippingMaskFabricObject.set({
|
||||
absolutePositioned: true,
|
||||
});
|
||||
|
||||
clippingMaskFabricObject.dirty = true;
|
||||
// clippingMaskFabricObject.dirty = true;
|
||||
clippingMaskFabricObject.setCoords();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user