Fix a few bugs with scaling in HTML-CS mode.

This commit is contained in:
Davide P. Cervone 2014-04-09 15:59:43 -04:00
parent defe996cf7
commit 239cfe33e5
3 changed files with 6 additions and 3 deletions

View File

@ -46,10 +46,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];
//
// <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();
//
var sscale = scale;
for (var i = 1; i < this.data.length; i++) {
if (this.data[i] && this.data[i].spanID) {
sscale = this.data[i].HTMLgetScale();

View File

@ -92,7 +92,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var stack = HTMLCSS.createStack(span);
var state = {
n: 0, Y: 0,
scale: this.HTMLgetScale(),
scale: this.scale,
isTop: isTop,
values: {},
VALUES: VALUES

View File

@ -2391,6 +2391,7 @@
style.marginLeft = style.marginRight = HTMLCSS.Em(space);
span.bbox.w += 2*space; span.bbox.r += 2*space;
}
this.SUPER(arguments).HTMLhandleSpace.call(this,span);
}
});
@ -2551,7 +2552,7 @@
if (stretch[i]) {box.bbox = this.data[i].HTMLstretchH(box,W).bbox}
if (box.bbox.w > WW) {WW = box.bbox.w}
}}
var t = HTMLCSS.TeX.rule_thickness, factor = HTMLCSS.FONTDATA.TeX_factor;
var t = HTMLCSS.TeX.rule_thickness * this.mscale, factor = HTMLCSS.FONTDATA.TeX_factor;
var base = boxes[this.base] || {bbox: this.HTMLzeroBBox()};
var x, y, z1, z2, z3, dw, k, delta = 0;
if (base.bbox.ic) {delta = 1.3*base.bbox.ic + .05} // adjust faked IC to be more in line with expeted results