mmultiscripts/menclose: ensure that HTMLgetScale is not called before HTMLcreateSpan. Fix Math Processing errors described in issue 362.

This commit is contained in:
Frédéric Wang 2012-12-25 15:46:35 +01:00
parent f8d4215519
commit ec105af431
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/autoload/menclose.js
@ -36,12 +38,13 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (values.color && !this.mathcolor) {values.mathcolor = values.color}
if (values.thickness == null) {values.thickness = ".075em"}
if (values.padding == null) {values.padding = ".2em"}
var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
var mu = this.HTMLgetMu(span);
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";
span = this.HTMLcreateSpan(span);
var scale = this.HTMLgetScale();
var stack = HTMLCSS.createStack(span);
var base = HTMLCSS.createBox(stack);
this.HTMLmeasureChild(0,base);

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/autoload/mmultiscripts.js
@ -43,7 +45,12 @@ 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 = (this.data[1]||this).HTMLgetScale();
var sscale;
if (this.data[1] && this.data[1].type !== "mprescripts") {
sscale = this.data[1].HTMLgetScale();
} else {
sscale = this.HTMLgetScale();
}
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}