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.thickness == null) {values.thickness = ".075em"}
if (values.padding == null) {values.padding = ".2em"} if (values.padding == null) {values.padding = ".2em"}
span = this.HTMLcreateSpan(span); span = this.HTMLcreateSpan(span);
var mu = this.HTMLgetMu(span); var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
var scale = this.HTMLgetScale();
var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale; var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale;
var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em) * scale; var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em) * scale;
var SOLID = HTMLCSS.Em(t)+" solid"; 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 BOX = this.HTMLgetScripts(stack,s);
var sub = BOX[0], sup = BOX[1], presub = BOX[2], presup = BOX[3]; var sub = BOX[0], sup = BOX[1], presub = BOX[2], presup = BOX[3];
var sscale; // <mmultiscripts> children other than the base can be <none/>,
if (this.data[1] && this.data[1].type != "mprescripts" && // <mprescripts/>, <mrow></mrow> etc so try to get HTMLgetScale from the
this.data[1].type != "none") { // first element with a spanID. See issue 362.
sscale = this.data[1].HTMLgetScale(); var sscale = this.HTMLgetScale();
} else { for (var i = 1; i < this.data.length; i++) {
sscale = this.HTMLgetScale(); 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 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; var u = base.bbox.h - q, v = base.bbox.d + r, delta = 0, p;
if (base.bbox.ic) {delta = base.bbox.ic} if (base.bbox.ic) {delta = base.bbox.ic}