From 0590a252b8177300bb97af2a1c31f61ec431730f Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:20:55 +0200 Subject: [PATCH] Skip resizing when height set to auto --- source/app/metrics/utils.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index e21dfc5a..583b0b48 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -336,7 +336,10 @@ export const svg = { width = Math.ceil(width * padding.width + padding.absolute.width) console.debug(`bounds after applying padding width=${width} (*${padding.width}+${padding.absolute.width}), height=${height} (*${padding.height}+${padding.absolute.height})`) //Resize svg - document.querySelector("svg").setAttribute("height", height) + if (document.querySelector("svg").getAttribute("height") === "auto") + console.debug("skipped height resizing because it was set to \"auto\"") + else + document.querySelector("svg").setAttribute("height", height) //Enable animations if (animated) document.querySelector("svg").classList.remove("no-animations")