Scan mmultiscripts children to find the first element with a spanID, as suggested by Davide.

This commit is contained in:
Frédéric Wang 2013-01-28 08:36:00 +01:00
parent 24f7626290
commit 9ae9306264
2 changed files with 11 additions and 8 deletions

View File

@ -39,8 +39,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (values.thickness == null) {values.thickness = ".075em"}
if (values.padding == null) {values.padding = ".2em"}
span = this.HTMLcreateSpan(span);
var mu = this.HTMLgetMu(span);
var scale = this.HTMLgetScale();
var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale;
var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em) * scale;
var SOLID = HTMLCSS.Em(t)+" solid";

View File

@ -45,13 +45,17 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var BOX = this.HTMLgetScripts(stack,s);
var sub = BOX[0], sup = BOX[1], presub = BOX[2], presup = BOX[3];
var sscale;
if (this.data[1] && this.data[1].type != "mprescripts" &&
this.data[1].type != "none") {
sscale = this.data[1].HTMLgetScale();
} else {
sscale = this.HTMLgetScale();
// <mmultiscripts> children other than the base can be <none/>,
// <mprescripts/>, <mrow></mrow> etc so try to get HTMLgetScale from the
// first element with a spanID. See issue 362.
var sscale = this.HTMLgetScale();
for (var i = 1; i < this.data.length; i++) {
if (this.data[i] && this.data[i].spanID) {
sscale = this.data[i].HTMLgetScale();
break;
}
}
var q = HTMLCSS.TeX.sup_drop * sscale, r = HTMLCSS.TeX.sub_drop * sscale;
var u = base.bbox.h - q, v = base.bbox.d + r, delta = 0, p;
if (base.bbox.ic) {delta = base.bbox.ic}