commit 9ae93062644e315e88a63c47fe38ffc270bc0569
parent 24f7626290a7d208ac3bdaf57ae57d9b064e8ded
Author: Frédéric Wang <fred.wang@free.fr>
Date: Mon, 28 Jan 2013 08:36:00 +0100
Scan mmultiscripts children to find the first element with a spanID, as suggested by Davide.
Diffstat:
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/unpacked/jax/output/HTML-CSS/autoload/menclose.js b/unpacked/jax/output/HTML-CSS/autoload/menclose.js
@@ -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";
diff --git a/unpacked/jax/output/HTML-CSS/autoload/mmultiscripts.js b/unpacked/jax/output/HTML-CSS/autoload/mmultiscripts.js
@@ -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}