feat: 1.固定图层缩略图(完成)
2.工具栏新增插槽(完成) 3.loadJSON的元素顺序回发生错误
This commit is contained in:
@@ -51,7 +51,6 @@ export function buildLayerAssociations(layer, canvasObjects) {
|
||||
*/
|
||||
export function restoreObjectLayerAssociations(layers, canvasObjects) {
|
||||
if (!layers || !canvasObjects || !isArray(canvasObjects)) return;
|
||||
|
||||
layers.forEach((layer) => {
|
||||
buildLayerAssociations(layer, canvasObjects);
|
||||
// 处理子图层
|
||||
@@ -242,7 +241,11 @@ export function restoreLayers(simplifiedLayers, canvasObjects) {
|
||||
if (fabricObj) {
|
||||
fabricObj.layerId = layer.id;
|
||||
fabricObj.layerName = layer.name;
|
||||
restoredLayer.fabricObject = fabricObj;
|
||||
restoredLayer.fabricObject = fabricObj.toObject([
|
||||
"id",
|
||||
"layerId",
|
||||
"type",
|
||||
]);
|
||||
} else {
|
||||
restoredLayer.fabricObject = null;
|
||||
}
|
||||
@@ -258,7 +261,7 @@ export function restoreLayers(simplifiedLayers, canvasObjects) {
|
||||
if (fabricObj) {
|
||||
fabricObj.layerId = layer.id;
|
||||
fabricObj.layerName = layer.name;
|
||||
return fabricObj;
|
||||
return fabricObj.toObject(["id", "layerId", "type"]);
|
||||
}
|
||||
return null;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user