From e2278a29617e9601032005bf2a83c52a9df783dd Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 24 Feb 2022 02:36:49 +0100 Subject: [PATCH] fix: make math foreignObject larger Chrome returns different height of BoundingRect than Firefox --- docs/morphisms/js/morphisms.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/morphisms/js/morphisms.js b/docs/morphisms/js/morphisms.js index 5756bcc..c1e28c7 100644 --- a/docs/morphisms/js/morphisms.js +++ b/docs/morphisms/js/morphisms.js @@ -48,11 +48,11 @@ async function add_search() { async function switch_katex(toggle=true) { let math_objects = document.getElementsByClassName("math"); for (let elt of math_objects) { - toggleKaTeX(elt, toggle); + await toggleKaTeX(elt, toggle); let fObj = elt.parentElement; let rect = elt.getElementsByClassName("math-tex")[0].getBoundingClientRect(); - fObj.setAttribute("width", rect.width+4); - fObj.setAttribute("height", rect.height+4); + fObj.setAttribute("width", rect.width+8); + fObj.setAttribute("height", rect.height+8); } };