mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2024-11-12 12:50:29 +01:00
fix: make math foreignObject larger
Chrome returns different height of BoundingRect than Firefox
This commit is contained in:
parent
c42a98459a
commit
e2278a2961
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user