www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 92c1a891dd03700639eefb4bae5318f7b3360fe1
parent 86792eaf44afc7d6311209f1932a4624016c9819
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Sat, 15 Feb 2014 12:35:07 -0500

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

Diffstat:
Munpacked/jax/output/SVG/autoload/multiline.js | 7+++++--
Munpacked/jax/output/SVG/jax.js | 11+++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/unpacked/jax/output/SVG/autoload/multiline.js b/unpacked/jax/output/SVG/autoload/multiline.js @@ -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, diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js @@ -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 () {