Remove deleted elements from svg export (#1021)
* Remove deleted elements from svg export * skip deleted elements * remove old comment Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
1546c00c0c
commit
0ad6f4ec6b
@ -291,8 +291,6 @@ export async function exportCanvas(
|
|||||||
if (!hasNonDeletedElements(elements)) {
|
if (!hasNonDeletedElements(elements)) {
|
||||||
return window.alert(t("alerts.cannotExportEmptyCanvas"));
|
return window.alert(t("alerts.cannotExportEmptyCanvas"));
|
||||||
}
|
}
|
||||||
// calculate smallest area to fit the contents in
|
|
||||||
|
|
||||||
if (type === "svg") {
|
if (type === "svg") {
|
||||||
const tempSvg = exportToSvg(elements, {
|
const tempSvg = exportToSvg(elements, {
|
||||||
exportBackground,
|
exportBackground,
|
||||||
|
@ -289,6 +289,7 @@ export function renderSceneToSvg(
|
|||||||
}
|
}
|
||||||
// render elements
|
// render elements
|
||||||
elements.forEach(element => {
|
elements.forEach(element => {
|
||||||
|
if (!element.isDeleted) {
|
||||||
renderElementToSvg(
|
renderElementToSvg(
|
||||||
element,
|
element,
|
||||||
rsvg,
|
rsvg,
|
||||||
@ -296,5 +297,6 @@ export function renderSceneToSvg(
|
|||||||
element.x + offsetX,
|
element.x + offsetX,
|
||||||
element.y + offsetY,
|
element.y + offsetY,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user