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:
Faustino Kialungila 2020-03-20 15:19:20 +01:00 committed by GitHub
parent 1546c00c0c
commit 0ad6f4ec6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -291,8 +291,6 @@ export async function exportCanvas(
if (!hasNonDeletedElements(elements)) {
return window.alert(t("alerts.cannotExportEmptyCanvas"));
}
// calculate smallest area to fit the contents in
if (type === "svg") {
const tempSvg = exportToSvg(elements, {
exportBackground,

View File

@ -289,12 +289,14 @@ export function renderSceneToSvg(
}
// render elements
elements.forEach(element => {
renderElementToSvg(
element,
rsvg,
svgRoot,
element.x + offsetX,
element.y + offsetY,
);
if (!element.isDeleted) {
renderElementToSvg(
element,
rsvg,
svgRoot,
element.x + offsetX,
element.y + offsetY,
);
}
});
}