If measurements can't be taken in getHDW(), move the test elements to the document.body instead in hopes that it is visible. Resolves issue #1353.
This commit is contained in:
parent
3ba60663df
commit
4d0af10b8d
|
@ -858,10 +858,17 @@
|
||||||
var test2 = CHTML.addElement(CHTML.CHTMLnode,"mjx-chartest",{className:name},[["mjx-char",{style:styles},[c,["mjx-box"]]]]);
|
var test2 = CHTML.addElement(CHTML.CHTMLnode,"mjx-chartest",{className:name},[["mjx-char",{style:styles},[c,["mjx-box"]]]]);
|
||||||
test1.firstChild.style.fontSize = test2.firstChild.style.fontSize = "";
|
test1.firstChild.style.fontSize = test2.firstChild.style.fontSize = "";
|
||||||
var em = 5*CHTML.em;
|
var em = 5*CHTML.em;
|
||||||
var d = (test2.offsetHeight-1000)/em;
|
var H1 = test1.offsetHeight, H2 = test2.offsetHeight, W = test1.offsetWidth;
|
||||||
var w = test1.offsetWidth/em, h = test1.offsetHeight/em - d;
|
|
||||||
CHTML.CHTMLnode.removeChild(test1);
|
CHTML.CHTMLnode.removeChild(test1);
|
||||||
CHTML.CHTMLnode.removeChild(test2);
|
CHTML.CHTMLnode.removeChild(test2);
|
||||||
|
if (H2 === 0) {
|
||||||
|
em = 5*CHTML.defaultEm;
|
||||||
|
var test = document.body.appendChild(document.createElement("div"));
|
||||||
|
test.appendChild(test1); test.appendChild(test2);
|
||||||
|
H1 = test1.offsetHeight, H2 = test2.offsetHeight, W = test1.offsetWidth;
|
||||||
|
document.body.removeChild(test);
|
||||||
|
}
|
||||||
|
var d = (H2-1000)/em, w = W/em, h = H1/em - d;
|
||||||
return {h:h, d:d, w:w}
|
return {h:h, d:d, w:w}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user