Merge branch 'issue391' into develop. Issue #391.

This commit is contained in:
Davide P. Cervone 2014-02-15 12:35:07 -05:00
commit 92c1a891dd
2 changed files with 16 additions and 2 deletions

View File

@ -86,10 +86,13 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
//
// Start with a fresh SVG element
// and make it full width if we are breaking to a specific width
// in the top-level math element
//
svg = this.SVG();
if (SVG.linebreakWidth < SVG.BIGDIMEN) {svg.w = SVG.linebreakWidth}
else {svg.w = SVG.cwidth/SVG.em * 1000}
if (isTop && parent.type !== "mtd") {
if (SVG.linebreakWidth < SVG.BIGDIMEN) {svg.w = SVG.linebreakWidth}
else {svg.w = SVG.cwidth/SVG.em * 1000}
}
var state = {
n: 0, Y: 0,

View File

@ -858,6 +858,17 @@
},
Align: function (svg,align,dx,dy) {
dx = ({left: dx, center: (this.w - svg.w)/2, right: this.w - svg.w - dx})[align] || 0;
//
// If we extend to the left of the current contents,
// move the contents to the right and adjust the bounding box
//
if (dx < 0) {
if (this.element.childNodes.length) {
this.element.setAttribute("transform","translate("+Math.floor(-dx)+",0)");
var g = SVG.Element("g"); g.appendChild(this.element); this.element = g;
}
this.l -= dx; this.w -= dx; this.r -= dx; dx = 0;
}
this.Add(svg,dx,dy);
},
Clean: function () {