Skip to content

Commit

Permalink
Merge pull request #72 from terrastruct/fix-export
Browse files Browse the repository at this point in the history
fix PNG export
  • Loading branch information
alixander authored Feb 10, 2025
2 parents e15996c + cc71d7f commit b65c7d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/modules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function exportPNG() {
Alert.show(`Compile a diagram to export`, 4000);
return;
}
const svgEl = document.getElementById("d2-svg");
const svgEl = document.querySelector(".d2-svg");

const viewBox = svgEl.getAttribute("viewBox").split(" ");
const width = parseFloat(viewBox[2]) * window.devicePixelRatio;
Expand Down

0 comments on commit b65c7d0

Please sign in to comment.