Merge branch 'issue824' into v2.4-beta. Issue #824.

This commit is contained in:
Davide P. Cervone 2014-05-27 15:18:29 -04:00
commit fe68969184
2 changed files with 6 additions and 2 deletions

View File

@ -777,7 +777,7 @@
this.idPostfix = "-zoom"; jax.root.toHTML(span,span); this.idPostfix = "";
this.zoomScale = 1;
var width = jax.root.HTMLspanElement().bbox.width;
var width = jax.root.HTMLspanElement().bbox.width, cwidth;
if (width) {
// Handle full-width displayed equations
// FIXME: this is a hack for now
@ -785,7 +785,10 @@
var id = (jax.root.id||"MathJax-Span-"+jax.root.spanID)+"-zoom";
var child = document.getElementById(id).firstChild;
while (child && child.style.width !== width) {child = child.nextSibling}
if (child) {child.style.width = "100%"}
if (child) {
var cwidth = child.offsetWidth; child.style.width = "100%";
if (cwidth > Mw) {span.style.width = (cwidth+100)+"px"}
}
}
//
// Get height and width of zoomed math and original math

View File

@ -432,6 +432,7 @@
Zoom: function (jax,span,math,Mw,Mh) {
jax.root.toNativeMML(span);
if (this.msieIE8HeightBug) {span.style.position = "absolute"}
if (nMML.widthBug) {span.style.width = span.parentNode.style.width = ""}
var mW = math.offsetWidth || math.scrollWidth,
mH = math.offsetHeight || math.scrollHeight;
var zW = span.offsetWidth, zH = span.offsetHeight;