Avoid resizing generated image when it has been rendered by server #201Avoid resizing generated image when it has been rendered by server #201

This commit is contained in:
lowlighter
2021-03-28 12:32:50 +02:00
parent 2917325092
commit 1b844ae244

View File

@@ -191,7 +191,7 @@
//Resize mock image //Resize mock image
mockresize() { mockresize() {
const svg = document.querySelector(".preview .image svg") const svg = document.querySelector(".preview .image svg")
if (svg) { if ((svg)&&(svg.getAttribute("height") === 99999)) {
const height = svg.querySelector("#metrics-end")?.getBoundingClientRect()?.y-svg.getBoundingClientRect()?.y const height = svg.querySelector("#metrics-end")?.getBoundingClientRect()?.y-svg.getBoundingClientRect()?.y
if (Number.isFinite(height)) if (Number.isFinite(height))
svg.setAttribute("height", height) svg.setAttribute("height", height)