Skip to content

Commit 60de385

Browse files
committed
Merge branch 'issue1353' into develop. Issue #1353.
2 parents 1f57017 + 4d0af10 commit 60de385

File tree

1 file changed

+9
-2
lines changed
  • unpacked/jax/output/CommonHTML

1 file changed

+9
-2
lines changed

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,17 @@
858858
var test2 = CHTML.addElement(CHTML.CHTMLnode,"mjx-chartest",{className:name},[["mjx-char",{style:styles},[c,["mjx-box"]]]]);
859859
test1.firstChild.style.fontSize = test2.firstChild.style.fontSize = "";
860860
var em = 5*CHTML.em;
861-
var d = (test2.offsetHeight-1000)/em;
862-
var w = test1.offsetWidth/em, h = test1.offsetHeight/em - d;
861+
var H1 = test1.offsetHeight, H2 = test2.offsetHeight, W = test1.offsetWidth;
863862
CHTML.CHTMLnode.removeChild(test1);
864863
CHTML.CHTMLnode.removeChild(test2);
864+
if (H2 === 0) {
865+
em = 5*CHTML.defaultEm;
866+
var test = document.body.appendChild(document.createElement("div"));
867+
test.appendChild(test1); test.appendChild(test2);
868+
H1 = test1.offsetHeight, H2 = test2.offsetHeight, W = test1.offsetWidth;
869+
document.body.removeChild(test);
870+
}
871+
var d = (H2-1000)/em, w = W/em, h = H1/em - d;
865872
return {h:h, d:d, w:w}
866873
},
867874

0 commit comments

Comments
 (0)