Merge branch 'issue428' into develop

Resolves issue #428.
This commit is contained in:
Davide P. Cervone 2013-04-29 16:28:33 -04:00
commit 4f28b81b08
2 changed files with 22 additions and 10 deletions

View File

@ -24,7 +24,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "2.1";
var VERSION = "2.1.1";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -419,6 +419,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
// Place the labels, if any
//
if (C[LABEL]) {
var min = stack.bbox.w, dw;
var indent = this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift");
if (indent.indentalignfirst !== MML.INDENTALIGN.INDENTALIGN) {indent.indentalign = indent.indentalignfirst}
if (indent.indentalign === MML.INDENTALIGN.AUTO) {indent.indentalign = this.displayAlign}
@ -427,14 +428,19 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var eqn = HTMLCSS.createStack(span,false,"100%");
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,indent.indentalign,0);
if (indent.indentshift && indent.indentalign !== MML.INDENTALIGN.CENTER) {
stack.style[indent.indentalign] = HTMLCSS.Em(HTMLCSS.length2em(indent.indentshift,mu));
dw = HTMLCSS.length2em(indent.indentshift,mu); min += dw;
stack.style[indent.indentalign] = HTMLCSS.Em(dw);
}
C[LABEL].parentNode.parentNode.removeChild(C[LABEL].parentNode);
HTMLCSS.addBox(eqn,C[LABEL]); HTMLCSS.alignBox(C[LABEL],CALIGN[LABEL],0);
if (HTMLCSS.msieRelativeWidthBug) {stack.style.top = C[LABEL].style.top = ""}
if (hasRelativeWidth) {stack.style.width = values.width; span.bbox.width = "100%"}
C[LABEL].style.marginRight = C[LABEL].style.marginLeft =
HTMLCSS.Em(HTMLCSS.length2em(values.minlabelspacing,mu));
dw = HTMLCSS.length2em(values.minlabelspacing,mu);
C[LABEL].style.marginRight = C[LABEL].style.marginLeft = HTMLCSS.Em(dw);
if (indent.indentalign === MML.INDENTALIGN.CENTER) {min += 4*dw + 2*C[LABEL].bbox.w}
else if (indent.indentalign !== CALIGN[LABEL]) {min += 2*dw + C[LABEL].bbox.w}
span.style.minWidth = span.bbox.minWidth =
eqn.style.minWidth = eqn.bbox.minWidth = HTMLCSS.Em(min);
}
//
// Finish the table
@ -458,7 +464,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
},
HTMLhandleSpace: function (span) {
span.bbox.keepPadding = true; span.bbox.exact = true;
if (!this.hasFrame) {span.style.paddingLeft = span.style.paddingRight = HTMLCSS.Em(1/6)}
if (!this.hasFrame && span.bbox.width == null)
{span.style.paddingLeft = span.style.paddingRight = HTMLCSS.Em(1/6)}
this.SUPER(arguments).HTMLhandleSpace.call(this,span);
}
});

View File

@ -686,7 +686,8 @@
//
// Get height and width of zoomed math and original math
//
span.style.position = math.style.position = "absolute";
span.style.position = "absolute";
if (!width) {math.style.position = "absolute"}
var zW = span.offsetWidth, zH = span.offsetHeight,
mH = math.offsetHeight, mW = math.offsetWidth;
if (mW === 0) {mW = math.parentNode.offsetWidth}; // IE7 gets mW == 0?
@ -1081,7 +1082,10 @@
if (bbox.rw + x > BBOX.rw) {BBOX.rw = bbox.rw + x}
if (bbox.lw + x < BBOX.lw) {BBOX.lw = bbox.lw + x}
if (bbox.width != null && !bbox.isFixed) {
if (BBOX.width == null) {parent.style.width = BBOX.width = "100%"}
if (BBOX.width == null) {
parent.style.width = BBOX.width = "100%";
if (bbox.minWidth) {parent.style.minWidth = BBOX.minWidth = bbox.minWidth}
}
span.style.width = bbox.width;
}
}
@ -1615,7 +1619,7 @@
if (BBOX.w + bbox.rw > BBOX.rw) {BBOX.rw = BBOX.w + bbox.rw}
BBOX.w += bbox.w;
if (child.style.paddingRight) {BBOX.w += HTMLCSS.unEm(child.style.paddingRight)*(child.scale||1)}
if (bbox.width) {BBOX.width = bbox.width}
if (bbox.width) {BBOX.width = bbox.width; BBOX.minWidth = bbox.minWidth}
if (bbox.ic) {BBOX.ic = bbox.ic} else {delete BBOX.ic}
if (BBOX.exactW && !bbox.exactW) {delete BBOX.exactW}
},
@ -2651,7 +2655,7 @@
// which makes it work even when minimum font size is in effect).
//
span.style.width = HTMLCSS.Em((Math.round(math.bbox.w*this.em)+.25)/HTMLCSS.outerEm);
span.style.display = "inline-block"; stack.style.width = "";
span.style.display = "inline-block";
//
// Adjust bbox to match outer em-size
//
@ -2659,7 +2663,8 @@
span.bbox.h *= f; span.bbox.d *= f; span.bbox.w *= f;
span.bbox.lw *= f; span.bbox.rw *= f;
if (math && math.bbox.width != null) {
stack.style.width = math.bbox.width;
span.style.minWidth = (math.bbox.minWidth || span.style.width);
span.style.width = stack.style.width = math.bbox.width;
box.style.width = "100%";
}
//