Merge branch 'issue703' into develop. Issue #703.
This commit is contained in:
commit
662023bed4
|
@ -41,8 +41,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
if (values.padding == null) {values.padding = ".2em"}
|
||||
span = this.HTMLcreateSpan(span);
|
||||
var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
|
||||
var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale; // padding for enclosure
|
||||
var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em); // thickness of lines (not scaled, see issue #414)
|
||||
var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale; // padding for enclosure
|
||||
var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em) * scale; // thickness of lines
|
||||
t = Math.max(1/HTMLCSS.em,t); // see issue #414
|
||||
var SOLID = HTMLCSS.Em(t)+" solid";
|
||||
|
||||
var stack = HTMLCSS.createStack(span);
|
||||
|
@ -154,7 +155,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
this.HTMLvmlElement(line,"stroke",{endarrow:"classic"});
|
||||
} else {
|
||||
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
||||
var l = Math.sqrt(W*W + (H+D)*(H+D)), f = 1/l * 10*scale/HTMLCSS.em * t/.075;
|
||||
var l = Math.sqrt(W*W + (H+D)*(H+D)), f = 1/l * 10*this.scale/HTMLCSS.em * t/.075;
|
||||
w = W * f; h = (H+D) * f; var x = W - t/2, y = t/2;
|
||||
if (y+h-.4*w < 0) {y = .4*w-h}
|
||||
this.HTMLsvgElement(svg.firstChild,"line",{
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1901,7 +1901,8 @@
|
|||
} else {
|
||||
var space = this.texSpacing();
|
||||
if (space !== "") {
|
||||
space = HTMLCSS.length2em(space,this.HTMLgetScale())/(span.scale||1);
|
||||
this.HTMLgetScale();
|
||||
space = HTMLCSS.length2em(space,this.scale)/(span.scale||1)*this.mscale;
|
||||
if (span.style.paddingLeft) {space += HTMLCSS.unEm(span.style.paddingLeft)}
|
||||
span.style.paddingLeft = HTMLCSS.Em(space);
|
||||
}
|
||||
|
@ -1909,6 +1910,7 @@
|
|||
},
|
||||
|
||||
HTMLgetScale: function () {
|
||||
if (this.scale) {return this.scale * this.mscale}
|
||||
var scale = 1, values = this.getValues("mathsize","scriptlevel","fontsize");
|
||||
if (this.style) {
|
||||
var span = this.HTMLspanElement();
|
||||
|
@ -1921,8 +1923,8 @@
|
|||
values.scriptminsize = HTMLCSS.length2em(this.Get("scriptminsize"));
|
||||
if (scale < values.scriptminsize) {scale = values.scriptminsize}
|
||||
}
|
||||
if (this.isToken) {scale *= HTMLCSS.length2em(values.mathsize)}
|
||||
return scale;
|
||||
this.scale = scale; this.mscale = HTMLCSS.length2em(values.mathsize);
|
||||
return scale * this.mscale;
|
||||
},
|
||||
HTMLgetMu: function (span) {
|
||||
var mu = 1, values = this.getValues("scriptlevel","scriptsizemultiplier");
|
||||
|
@ -2057,7 +2059,7 @@
|
|||
if (bbox.skew && text.length !== 1) {delete bbox.skew}
|
||||
if (bbox.rw > bbox.w && text.length === 1 && !variant.noIC) {
|
||||
bbox.ic = bbox.rw - bbox.w;
|
||||
HTMLCSS.createBlank(span,bbox.ic);
|
||||
HTMLCSS.createBlank(span,bbox.ic/this.mscale);
|
||||
bbox.w = bbox.rw;
|
||||
}
|
||||
this.HTMLhandleSpace(span);
|
||||
|
@ -2129,7 +2131,8 @@
|
|||
// Handle large operator centering
|
||||
//
|
||||
if (values.largeop) {
|
||||
var p = (span.bbox.h - span.bbox.d)/2 - HTMLCSS.TeX.axis_height*span.scale;
|
||||
var a = HTMLCSS.TeX.axis_height * this.scale * this.mscale
|
||||
var p = (span.bbox.h - span.bbox.d)/2 - a;
|
||||
if (HTMLCSS.safariVerticalAlignBug && span.lastChild.nodeName === "IMG") {
|
||||
span.lastChild.style.verticalAlign =
|
||||
HTMLCSS.Em(HTMLCSS.unEm(span.lastChild.style.verticalAlign||0)/HTMLCSS.em-p/span.scale);
|
||||
|
@ -2143,7 +2146,7 @@
|
|||
span.bbox.h -= p; span.bbox.d += p;
|
||||
if (span.bbox.rw > span.bbox.w) {
|
||||
span.bbox.ic = span.bbox.rw-span.bbox.w;
|
||||
HTMLCSS.createBlank(span,span.bbox.ic);
|
||||
HTMLCSS.createBlank(span,span.bbox.ic/this.mscale);
|
||||
span.bbox.w = span.bbox.rw;
|
||||
}
|
||||
}
|
||||
|
@ -2204,7 +2207,7 @@
|
|||
this.HTMLremoveColor();
|
||||
var values = this.getValues("symmetric","maxsize","minsize");
|
||||
var span = this.HTMLspanElement(), mu = this.HTMLgetMu(span), H;
|
||||
var axis = HTMLCSS.TeX.axis_height, scale = span.scale;
|
||||
var scale = this.HTMLgetScale(), axis = HTMLCSS.TeX.axis_height * scale;
|
||||
if (values.symmetric) {H = 2*Math.max(h-axis,d+axis)} else {H = h + d}
|
||||
values.maxsize = HTMLCSS.length2em(values.maxsize,mu,span.bbox.h+span.bbox.d);
|
||||
values.minsize = HTMLCSS.length2em(values.minsize,mu,span.bbox.h+span.bbox.d);
|
||||
|
@ -2280,12 +2283,12 @@
|
|||
toHTML: function (span) {
|
||||
span = this.HTMLcreateSpan(span);
|
||||
var values = this.getValues("height","depth","width");
|
||||
var mu = this.HTMLgetMu(span);
|
||||
var mu = this.HTMLgetMu(span); this.HTMLgetScale();
|
||||
values.mathbackground = this.mathbackground;
|
||||
if (this.background && !this.mathbackground) {values.mathbackground = this.background}
|
||||
var h = HTMLCSS.length2em(values.height,mu),
|
||||
d = HTMLCSS.length2em(values.depth,mu),
|
||||
w = HTMLCSS.length2em(values.width,mu);
|
||||
var h = HTMLCSS.length2em(values.height,mu) * this.mscale,
|
||||
d = HTMLCSS.length2em(values.depth,mu) * this.mscale,
|
||||
w = HTMLCSS.length2em(values.width,mu) * this.mscale;
|
||||
HTMLCSS.createSpace(span,h,d,w,values.mathbackground,true);
|
||||
return span;
|
||||
}
|
||||
|
@ -2323,9 +2326,10 @@
|
|||
else {HTMLCSS.Measured(child,box)}
|
||||
var values = this.getValues("height","depth","width","lspace","voffset"),
|
||||
x = 0, y = 0, mu = this.HTMLgetMu(span);
|
||||
this.HTMLgetScale();
|
||||
if (values.lspace) {x = this.HTMLlength2em(box,values.lspace,mu)}
|
||||
if (values.voffset) {y = this.HTMLlength2em(box,values.voffset,mu)}
|
||||
HTMLCSS.placeBox(box,x,y);
|
||||
HTMLCSS.placeBox(box,x,y); x /= this.mscale; y /= this.mscale;
|
||||
span.bbox = {
|
||||
h: box.bbox.h, d: box.bbox.d, w: box.bbox.w, exactW: true,
|
||||
lw: Math.min(0,box.bbox.lw+x), rw: Math.max(box.bbox.w,box.bbox.rw+x),
|
||||
|
@ -2350,7 +2354,7 @@
|
|||
if (m == null) {m = -HTMLCSS.BIGDIMEN}
|
||||
var match = String(length).match(/width|height|depth/);
|
||||
var size = (match ? span.bbox[match[0].charAt(0)] : (d ? span.bbox[d] : 0));
|
||||
var v = HTMLCSS.length2em(length,mu,size);
|
||||
var v = HTMLCSS.length2em(length,mu,size/this.mscale) * this.mscale;
|
||||
if (d && String(length).match(/^\s*[-+]/))
|
||||
{return Math.max(m,span.bbox[d]+v)} else {return v}
|
||||
},
|
||||
|
@ -2418,7 +2422,7 @@
|
|||
HTMLCSS.placeBox(den,num.bbox.w+bevel.bbox.w-delta,(den.bbox.d-den.bbox.h)/2+a-delta);
|
||||
} else {
|
||||
var W = Math.max(num.bbox.w,den.bbox.w);
|
||||
var t = HTMLCSS.thickness2em(values.linethickness,scale), p,q, u,v;
|
||||
var t = HTMLCSS.thickness2em(values.linethickness,this.scale)*this.mscale, p,q, u,v;
|
||||
var mt = HTMLCSS.TeX.min_rule_thickness/this.em;
|
||||
if (isDisplay) {u = HTMLCSS.TeX.num1; v = HTMLCSS.TeX.denom1}
|
||||
else {u = (t === 0 ? HTMLCSS.TeX.num3 : HTMLCSS.TeX.num2); v = HTMLCSS.TeX.denom2}
|
||||
|
@ -2449,11 +2453,12 @@
|
|||
// Add nulldelimiterspace around the fraction
|
||||
// (TeXBook pg 150 and Appendix G rule 15e)
|
||||
//
|
||||
var space = HTMLCSS.TeX.nulldelimiterspace;
|
||||
var space = HTMLCSS.TeX.nulldelimiterspace * this.mscale;
|
||||
var style = span.firstChild.style;
|
||||
style.marginLeft = style.marginRight = HTMLCSS.Em(space);
|
||||
span.bbox.w += 2*space; span.bbox.r += 2*space;
|
||||
}
|
||||
this.SUPER(arguments).HTMLhandleSpace.call(this,span);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2614,7 +2619,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
|
||||
|
@ -2688,13 +2693,11 @@
|
|||
if (sup) {sup.bbox.w += s; sup.bbox.rw = Math.max(sup.bbox.w,sup.bbox.rw)}
|
||||
if (sub) {sub.bbox.w += s; sub.bbox.rw = Math.max(sub.bbox.w,sub.bbox.rw)}
|
||||
HTMLCSS.placeBox(base,0,0);
|
||||
var sscale;
|
||||
var sscale = scale;
|
||||
if (sup) {
|
||||
sscale = this.data[this.sup].HTMLgetScale();
|
||||
} else if (sub) {
|
||||
sscale = this.data[this.sub].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;
|
||||
|
@ -2826,8 +2829,8 @@
|
|||
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(box,HW,D),box)}
|
||||
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(box,HW),box)}
|
||||
else {HTMLCSS.Measured(child,box)}
|
||||
// FIXME: should the axis height be scaled?
|
||||
HTMLCSS.placeBox(box,0,HTMLCSS.TeX.axis_height-(box.bbox.h+box.bbox.d)/2+box.bbox.d);
|
||||
var a = HTMLCSS.TeX.axis_height * this.HTMLgetScale();
|
||||
HTMLCSS.placeBox(box,0,a-(box.bbox.h+box.bbox.d)/2+box.bbox.d);
|
||||
} else {
|
||||
var html = this.data[0].toHTML(span,HW,D);
|
||||
if (D != null) {html = this.data[0].HTMLstretchV(box,HW,D)}
|
||||
|
|
|
@ -99,7 +99,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
toSVG: function (HW,DD) {
|
||||
this.SVGgetStyles();
|
||||
|
||||
var svg = this.SVG();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg);
|
||||
this.SVGhandleSpace(svg);
|
||||
var base = this.SVGdataStretched(0,HW,DD);
|
||||
|
||||
|
@ -107,9 +107,10 @@ MathJax.Hub.Register.StartupHook("SVG 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.SVGgetMu(svg), scale = this.SVGgetScale();
|
||||
var mu = this.SVGgetMu(svg);
|
||||
var p = SVG.length2em(values.padding,mu,1/SVG.em) * scale; // padding for enclosure
|
||||
var t = SVG.length2em(values.thickness,mu,1/SVG.em); // thickness of lines (not scaled, see issue #414)
|
||||
var t = SVG.length2em(values.thickness,mu,1/SVG.em); // thickness of lines
|
||||
t = Math.max(1/SVG.em,t); // see issue #414
|
||||
var H = base.h+p+t, D = base.d+p+t, W = base.w+2*(p+t);
|
||||
var dx = 0, w, h, i, m, borders = [false,false,false,false];
|
||||
if (!values.mathcolor) {values.mathcolor = "black"}
|
||||
|
|
|
@ -32,8 +32,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
MML.mmultiscripts.Augment({
|
||||
toSVG: function (HW,D) {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG(); this.SVGhandleSpace(svg);
|
||||
var scale = this.SVGgetScale();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||
var base = (this.data[this.base] ? this.SVGdataStretched(this.base,HW,D) : SVG.BBOX.G().Clean());
|
||||
var x_height = SVG.TeX.x_height * scale,
|
||||
s = SVG.TeX.scriptspace * scale * .75; // FIXME: .75 can be removed when IC is right?
|
||||
|
|
|
@ -33,7 +33,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
MML.mtable.Augment({
|
||||
toSVG: function (span) {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg);
|
||||
if (this.data.length === 0) {this.SVGsaveData(svg);return svg}
|
||||
var values = this.getValues("columnalign","rowalign","columnspacing","rowspacing",
|
||||
"columnwidth","equalcolumns","equalrows",
|
||||
|
@ -42,7 +42,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
// Handle relative width as fixed width in relation to container
|
||||
if (values.width.match(/%$/))
|
||||
{svg.width = values.width = Math.floor(SVG.cwidth*parseFloat(values.width)/100)+"px"}
|
||||
var scale = this.SVGgetScale(), mu = this.SVGgetMu(svg);
|
||||
var mu = this.SVGgetMu(svg);
|
||||
var LABEL = -1;
|
||||
|
||||
var H = [], D = [], W = [], A = [], C = [], i, j, J = -1,
|
||||
|
|
|
@ -96,7 +96,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
|
||||
var state = {
|
||||
n: 0, Y: 0,
|
||||
scale: this.SVGgetScale(),
|
||||
scale: this.scale,
|
||||
isTop: isTop,
|
||||
values: {},
|
||||
VALUES: VALUES
|
||||
|
|
|
@ -1029,8 +1029,8 @@
|
|||
toSVG: function () {
|
||||
this.SVGgetStyles();
|
||||
var variant = this.SVGgetVariant();
|
||||
var svg = this.SVG();
|
||||
svg.scale = this.SVGgetScale(); this.SVGhandleSpace(svg);
|
||||
var svg = this.SVG(); this.SVGgetScale(svg);
|
||||
this.SVGhandleSpace(svg);
|
||||
for (var i = 0, m = this.data.length; i < m; i++) {
|
||||
if (this.data[i]) {
|
||||
var child = svg.Add(this.data[i].toSVG(variant,svg.scale),svg.w,0,true);
|
||||
|
@ -1152,7 +1152,8 @@
|
|||
}
|
||||
} else {
|
||||
var space = this.texSpacing();
|
||||
if (space !== "") {svg.x += SVG.length2em(space,this.SVGgetScale())/svg.scale}
|
||||
this.SVGgetScale();
|
||||
if (space !== "") {svg.x += SVG.length2em(space,this.scale)*this.mscale}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1275,7 +1276,8 @@
|
|||
return SVG.FONTDATA.VARIANT[variant];
|
||||
},
|
||||
|
||||
SVGgetScale: function () {
|
||||
SVGgetScale: function (svg) {
|
||||
if (this.mscale) {return this.scale * this.mscale}
|
||||
var scale = 1,
|
||||
values = this.getValues("mathsize","scriptlevel","fontsize");
|
||||
if ((this.styles||{}).fontSize && !values.fontsize) {values.fontsize = this.styles.fontSize}
|
||||
|
@ -1286,8 +1288,9 @@
|
|||
values.scriptminsize = SVG.length2em(this.Get("scriptminsize"))/1000;
|
||||
if (scale < values.scriptminsize) {scale = values.scriptminsize}
|
||||
}
|
||||
if (this.isToken) {scale *= SVG.length2em(values.mathsize)/1000}
|
||||
return scale;
|
||||
this.scale = scale; this.mscale = SVG.length2em(values.mathsize)/1000;
|
||||
if (svg) {svg.scale = scale; if (this.isToken) {svg.scale *= this.mscale}}
|
||||
return scale * this.mscale;
|
||||
},
|
||||
SVGgetMu: function (svg) {
|
||||
var mu = 1, values = this.getValues("scriptlevel","scriptsizemultiplier");
|
||||
|
@ -1346,7 +1349,9 @@
|
|||
MML.mo.Augment({
|
||||
toSVG: function (HW,D) {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.svg = this.SVG(); this.SVGhandleSpace(svg);
|
||||
var svg = this.svg = this.SVG();
|
||||
var scale = this.SVGgetScale(svg);
|
||||
this.SVGhandleSpace(svg);
|
||||
if (this.data.length == 0) {svg.Clean(); this.SVGsaveData(svg); return svg}
|
||||
//
|
||||
// Stretch the operator, if that is requested
|
||||
|
@ -1356,7 +1361,7 @@
|
|||
//
|
||||
// Get the variant, and check for operator size
|
||||
//
|
||||
var scale = this.SVGgetScale(), variant = this.SVGgetVariant();
|
||||
var variant = this.SVGgetVariant();
|
||||
var values = this.getValues("largeop","displaystyle");
|
||||
if (values.largeop)
|
||||
{variant = SVG.FONTDATA.VARIANT[values.displaystyle ? "-largeOp" : "-smallOp"]}
|
||||
|
@ -1454,7 +1459,7 @@
|
|||
SVGstretchV: function (h,d) {
|
||||
var svg = this.svg || this.toSVG();
|
||||
var values = this.getValues("symmetric","maxsize","minsize");
|
||||
var axis = SVG.TeX.axis_height, mu = this.SVGgetMu(svg), H;
|
||||
var axis = SVG.TeX.axis_height*svg.scale, mu = this.SVGgetMu(svg), H;
|
||||
if (values.symmetric) {H = 2*Math.max(h-axis,d+axis)} else {H = h + d}
|
||||
values.maxsize = SVG.length2em(values.maxsize,mu,svg.h+svg.d);
|
||||
values.minsize = SVG.length2em(values.minsize,mu,svg.h+svg.d);
|
||||
|
@ -1491,7 +1496,7 @@
|
|||
toSVG: function () {
|
||||
if (SVG.config.mtextFontInherit || this.Parent().type === "merror") {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg);
|
||||
this.SVGhandleSpace(svg);
|
||||
var variant = this.SVGgetVariant(), def = {direction:this.Get("dir")};
|
||||
if (variant.bold) {def["font-weight"] = "bold"}
|
||||
|
@ -1547,10 +1552,10 @@
|
|||
var values = this.getValues("height","depth","width");
|
||||
values.mathbackground = this.mathbackground;
|
||||
if (this.background && !this.mathbackground) {values.mathbackground = this.background}
|
||||
var svg = this.SVG(), mu = this.SVGgetMu(svg);
|
||||
svg.h = SVG.length2em(values.height,mu) / svg.scale;
|
||||
svg.d = SVG.length2em(values.depth,mu) / svg.scale;
|
||||
svg.w = svg.r = SVG.length2em(values.width,mu) / svg.scale;
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg), mu = this.SVGgetMu(svg);
|
||||
svg.h = SVG.length2em(values.height,mu) * scale;
|
||||
svg.d = SVG.length2em(values.depth,mu) * scale;
|
||||
svg.w = svg.r = SVG.length2em(values.width,mu) * scale;
|
||||
if (svg.w < 0) {svg.x = svg.w; svg.w = svg.r = 0}
|
||||
if (svg.h < -svg.d) {svg.d = -svg.h}
|
||||
svg.l = 0; svg.Clean();
|
||||
|
@ -1563,7 +1568,7 @@
|
|||
MML.mphantom.Augment({
|
||||
toSVG: function (HW,D) {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
var svg = this.SVG(); this.SVGgetScale(svg);
|
||||
if (this.data[0] != null) {
|
||||
this.SVGhandleSpace(svg); svg.Add(this.SVGdataStretched(0,HW,D)); svg.Clean();
|
||||
while (svg.element.firstChild) {svg.element.removeChild(svg.element.firstChild)}
|
||||
|
@ -1580,7 +1585,7 @@
|
|||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
if (this.data[0] != null) {
|
||||
this.SVGhandleSpace(svg);
|
||||
this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||
var pad = this.SVGdataStretched(0,HW,D), mu = this.SVGgetMu(svg);
|
||||
var values = this.getValues("height","depth","width","lspace","voffset"), x = 0, y = 0;
|
||||
if (values.lspace) {x = this.SVGlength2em(pad,values.lspace,mu)}
|
||||
|
@ -1601,7 +1606,7 @@
|
|||
if (m == null) {m = -SVG.BIGDIMEN}
|
||||
var match = String(length).match(/width|height|depth/);
|
||||
var size = (match ? svg[match[0].charAt(0)] : (d ? svg[d] : 0));
|
||||
var v = SVG.length2em(length,mu,size);
|
||||
var v = SVG.length2em(length,mu,size/this.mscale)*this.mscale;
|
||||
if (d && String(length).match(/^\s*[-+]/))
|
||||
{return Math.max(m,svg[d]+v)} else {return v}
|
||||
}
|
||||
|
@ -1665,12 +1670,11 @@
|
|||
MML.mfrac.Augment({
|
||||
toSVG: function () {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
var frac = BBOX(); this.SVGhandleSpace(frac);
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg);
|
||||
var frac = BBOX(); frac.scale = svg.scale; this.SVGhandleSpace(frac);
|
||||
var num = this.SVGchildSVG(0), den = this.SVGchildSVG(1);
|
||||
var values = this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled");
|
||||
var scale = svg.scale = frac.scale = this.SVGgetScale(),
|
||||
isDisplay = values.displaystyle;
|
||||
var isDisplay = values.displaystyle;
|
||||
var a = SVG.TeX.axis_height * scale;
|
||||
if (values.bevelled) {
|
||||
var delta = (isDisplay ? 400 : 150);
|
||||
|
@ -1681,7 +1685,7 @@
|
|||
frac.Add(den,num.w+bevel.w-delta,(den.d-den.h)/2+a-delta);
|
||||
} else {
|
||||
var W = Math.max(num.w,den.w);
|
||||
var t = SVG.thickness2em(values.linethickness,scale), p,q, u,v;
|
||||
var t = SVG.thickness2em(values.linethickness,this.scale)*this.mscale, p,q, u,v;
|
||||
var mt = SVG.TeX.min_rule_thickness/SVG.em * 1000;
|
||||
if (isDisplay) {u = SVG.TeX.num1; v = SVG.TeX.denom1}
|
||||
else {u = (t === 0 ? SVG.TeX.num3 : SVG.TeX.num2); v = SVG.TeX.denom2}
|
||||
|
@ -1712,17 +1716,17 @@
|
|||
// Add nulldelimiterspace around the fraction
|
||||
// (TeXBook pg 150 and Appendix G rule 15e)
|
||||
//
|
||||
svg.x = svg.X = SVG.TeX.nulldelimiterspace;
|
||||
svg.x = svg.X = SVG.TeX.nulldelimiterspace * this.mscale;
|
||||
}
|
||||
this.SUPER(arguments).SVGhandleSpace.call(this,svg);
|
||||
}
|
||||
});
|
||||
|
||||
MML.msqrt.Augment({
|
||||
toSVG: function () {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG(); this.SVGhandleSpace(svg);
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||
var base = this.SVGchildSVG(0), rule, surd;
|
||||
var scale = this.SVGgetScale();
|
||||
var t = SVG.TeX.rule_thickness * scale, p,q, H, x = 0;
|
||||
if (this.Get("displaystyle")) {p = SVG.TeX.x_height * scale} else {p = t}
|
||||
q = Math.max(t + p/4,1000*SVG.TeX.min_root_space/SVG.em);
|
||||
|
@ -1813,9 +1817,7 @@
|
|||
if (!values.displaystyle && this.data[this.base] != null &&
|
||||
this.data[this.base].CoreMO().Get("movablelimits"))
|
||||
{return MML.msubsup.prototype.toSVG.call(this)}
|
||||
var svg = this.SVG();
|
||||
this.SVGhandleSpace(svg);
|
||||
var scale = svg.scale = this.SVGgetScale();
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||
var boxes = [], stretch = [], box, i, m, W = -SVG.BIGDIMEN, WW = W;
|
||||
for (i = 0, m = this.data.length; i < m; i++) {
|
||||
if (this.data[i] != null) {
|
||||
|
@ -1835,7 +1837,7 @@
|
|||
if (stretch[i]) {boxes[i] = this.data[i].SVGstretchH(W)}
|
||||
if (boxes[i].w > WW) {WW = boxes[i].w}
|
||||
}}
|
||||
var t = SVG.TeX.rule_thickness;
|
||||
var t = SVG.TeX.rule_thickness * this.mscale;
|
||||
var base = boxes[this.base] || {w:0, h:0, d:0, H:0, D:0, l:0, r:0, y:0, scale:scale};
|
||||
var x, y, z1, z2, z3, dw, k, delta = 0;
|
||||
if (base.ic) {delta = 1.3*base.ic + .05} // adjust faked IC to be more in line with expeted results
|
||||
|
@ -1889,9 +1891,8 @@
|
|||
MML.msubsup.Augment({
|
||||
toSVG: function (HW,D) {
|
||||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
this.SVGhandleSpace(svg);
|
||||
var scale = svg.scale = this.SVGgetScale(), mu = this.SVGgetMu(svg);
|
||||
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||
var mu = this.SVGgetMu(svg);
|
||||
var base = svg.Add(this.SVGdataStretched(this.base,HW,D));
|
||||
var sscale = (this.data[this.sup] || this.data[this.sub] || this).SVGgetScale();
|
||||
var x_height = SVG.TeX.x_height * scale, s = SVG.TeX.scriptspace * scale;
|
||||
|
@ -2042,11 +2043,9 @@
|
|||
var svg = this.SVG();
|
||||
this.SVGhandleSpace(svg);
|
||||
if (this.data[0] != null) {
|
||||
var box = this.data[0].SVGdataStretched(0,HW,D), y = 0;
|
||||
if (this.texClass === MML.TEXCLASS.VCENTER) {
|
||||
// FIXME: should the axis height be scaled?
|
||||
y = SVG.TeX.axis_height - (box.h+box.d)/2 + box.d;
|
||||
}
|
||||
var box = this.SVGdataStretched(0,HW,D), y = 0;
|
||||
if (this.texClass === MML.TEXCLASS.VCENTER)
|
||||
{y = SVG.TeX.axis_height - (box.h+box.d)/2 + box.d}
|
||||
svg.Add(box,0,y);
|
||||
svg.ic = box.ic;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user