fix: not cloning elements on export polluting Scene mapping (#7276)
This commit is contained in:
parent
3d4ff59f40
commit
ae5b9a4ffd
@ -11,7 +11,7 @@ import {
|
|||||||
getElementAbsoluteCoords,
|
getElementAbsoluteCoords,
|
||||||
} from "../element/bounds";
|
} from "../element/bounds";
|
||||||
import { renderSceneToSvg, renderStaticScene } from "../renderer/renderScene";
|
import { renderSceneToSvg, renderStaticScene } from "../renderer/renderScene";
|
||||||
import { distance, getFontString } from "../utils";
|
import { cloneJSON, distance, getFontString } from "../utils";
|
||||||
import { AppState, BinaryFiles } from "../types";
|
import { AppState, BinaryFiles } from "../types";
|
||||||
import {
|
import {
|
||||||
DEFAULT_EXPORT_PADDING,
|
DEFAULT_EXPORT_PADDING,
|
||||||
@ -52,8 +52,9 @@ const __createSceneForElementsHack__ = (
|
|||||||
// we can't duplicate elements to regenerate ids because we need the
|
// we can't duplicate elements to regenerate ids because we need the
|
||||||
// orig ids when embedding. So we do another hack of not mapping element
|
// orig ids when embedding. So we do another hack of not mapping element
|
||||||
// ids to Scene instances so that we don't override the editor elements
|
// ids to Scene instances so that we don't override the editor elements
|
||||||
// mapping
|
// mapping.
|
||||||
scene.replaceAllElements(elements, false);
|
// We still need to clone the objects themselves to regen references.
|
||||||
|
scene.replaceAllElements(cloneJSON(elements), false);
|
||||||
return scene;
|
return scene;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user