From 2c3a5f0b79c7b160af41734fd5b290327ad63fba Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 14 May 2014 09:29:09 -0400 Subject: [PATCH 01/10] Apparently, node.js uses uppercase nodeName, so use toLowerCase() to change it. --- unpacked/jax/output/SVG/jax.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index e96bf73dd..d11bf8f74 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -166,7 +166,7 @@ this.linebreakSpan = HTML.Element("span",null, [["hr",{style: {width:"auto", size:1, padding:0, border:0, margin:0}}]]); - // Set up styles + // Set up styles return AJAX.Styles(this.config.styles,["InitializeSVG",this]); }, @@ -381,7 +381,7 @@ // most browsers can't position to an SVG element properly. // hashCheck: function (target) { - if (target && target.nodeName === "g") + if (target && target.nodeName.toLowerCase() === "g") {do {target = target.parentNode} while (target && target.firstChild.nodeName !== "svg")} return target; }, @@ -815,8 +815,8 @@ if (dx) {svg.x += dx}; if (dy) {svg.y += dy}; if (svg.element) { if (svg.removeable && svg.element.childNodes.length === 1 && svg.n === 1) { - var child = svg.element.firstChild; - if (child.nodeName === "use" || child.nodeName === "rect") { + var child = svg.element.firstChild, nodeName = child.nodeName.toLowerCase(); + if (nodeName === "use" || nodeName === "rect") { svg.element = child; svg.scale = svg.childScale; var x = svg.childX, y = svg.childY; svg.x += x; svg.y += y; @@ -828,13 +828,12 @@ if (Math.abs(svg.x) < 1 && Math.abs(svg.y) < 1) { svg.remove = svg.removeable; } else { - if (svg.element.nodeName === "g") { + nodeName = svg.element.nodeName.toLowerCase(); + if (nodeName === "g") { if (!svg.element.firstChild) {svg.remove = svg.removeable} else {svg.element.setAttribute("transform","translate("+Math.floor(svg.x)+","+Math.floor(svg.y)+")")} - } else if (svg.element.nodeName === "line" || - svg.element.nodeName === "polygon" || - svg.element.nodeName === "path" || - svg.element.nodeName === "a") { + } else if (nodeName === "line" || nodeName === "polygon" || + nodeName === "path" || nodeName === "a") { svg.element.setAttribute("transform","translate("+Math.floor(svg.x)+","+Math.floor(svg.y)+")"); } else { svg.element.setAttribute("x",Math.floor(svg.x/svg.scale)); @@ -1197,7 +1196,8 @@ // Add background color // if (values.background !== MML.COLOR.TRANSPARENT) { - if (svg.element.nodeName !== "g" && svg.element.nodeName !== "svg") { + var nodeName = svg.element.nodeName.toLowerCase(); + if (nodeName !== "g" && nodeName !== "svg") { var g = SVG.Element("g"); g.appendChild(svg.element); svg.element = g; svg.removeable = true; } From 267a9a90eb81904402d8126754bc01444be4ef97 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 14 May 2014 09:30:05 -0400 Subject: [PATCH 02/10] Use width and height attributes rather than styles. --- unpacked/jax/output/SVG/jax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index d11bf8f74..0bb8ac894 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -2009,8 +2009,8 @@ // var l = Math.max(-svg.l,0), r = Math.max(svg.r-svg.w,0); var style = svg.element.style; - style.width = SVG.Ex(l+svg.w+r); - style.height = SVG.Ex(svg.H+svg.D+2*SVG.em); + svg.element.setAttribute("width",SVG.Ex(l+svg.w+r)); + svg.element.setAttribute("height",SVG.Ex(svg.H+svg.D+2*SVG.em)); style.verticalAlign = SVG.Ex(-svg.D-3*SVG.em); // remove 2 extra pixels added below plus padding style.marginLeft = SVG.Ex(-l); style.marginRight = SVG.Ex(-r); svg.element.setAttribute("viewBox",(-l)+" "+(-svg.H-SVG.em)+" "+(l+svg.w+r)+" "+(svg.H+svg.D+2*SVG.em)); From 2a11309edd7826a1eed50e619c643a4e4c72cd74 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 14 May 2014 14:30:28 -0400 Subject: [PATCH 03/10] Add options useFontCache and useGlobalCache to control use of elements. Also add Fixed() method to make shorter values for scale and viewport. --- unpacked/jax/output/SVG/config.js | 2 + unpacked/jax/output/SVG/jax.js | 63 +++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 12 deletions(-) diff --git a/unpacked/jax/output/SVG/config.js b/unpacked/jax/output/SVG/config.js index 1e0b061b2..42dcb0109 100644 --- a/unpacked/jax/output/SVG/config.js +++ b/unpacked/jax/output/SVG/config.js @@ -41,6 +41,8 @@ MathJax.OutputJax.SVG = MathJax.OutputJax({ undefinedFamily: "STIXGeneral,'Arial Unicode MS',serif", // fonts to use for missing characters addMMLclasses: false, // keep MathML structure and use CSS classes to mark elements + useFontCache: true, // use elements to re-use font paths rather than repeat paths every time + useGlobalCache: true, // store fonts in a global for use in all equations, or one in each equation EqnChunk: (MathJax.Hub.Browser.isMobile ? 10: 50), // number of equations to process before showing them diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 0bb8ac894..f24f07344 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -375,6 +375,20 @@ // state.SVGlast = state.SVGeqn; }, + + clearGlyphs: function (reset) { + if (this.config.useFontCache) { + if (this.config.useGlobalCache) { + DEFS = document.getElementById("MathJax_SVG_Glyphs"); + DEFS.innerHTML = ""; + } else { + DEFS = this.Element("defs"); + DEFN++; + } + GLYPHS = {}; + if (reset) {DEFN = 0} + } + }, // // Return the containing HTML element rather than the SVG element, since @@ -465,6 +479,10 @@ Percent: function (m) { return (100*m).toFixed(1).replace(/\.?0+$/,"") + "%"; }, + Fixed: function (m,n) { + if (Math.abs(m) < .0006) {return "0"} + return m.toFixed(n||3).replace(/\.?0+$/,""); + }, length2em: function (length,mu,size) { if (typeof(length) !== "string") {length = length.toString()} if (length === "") {return ""} @@ -929,7 +947,7 @@ type: "rect", removeable: false, Init: function (h,d,w,t,dash,color,def) { if (def == null) {def = {}}; def.fill = "none"; - def["stroke-width"] = t.toFixed(2).replace(/\.?0+$/,""); + def["stroke-width"] = SVG.Fixed(t,2); def.width = Math.floor(w-t); def.height = Math.floor(h+d-t); def.transform = "translate("+Math.floor(t/2)+","+Math.floor(-d+t/2)+")"; if (dash === "dashed") @@ -945,7 +963,7 @@ Init: function (w,t,dash,color,def) { if (def == null) {def = {"stroke-linecap":"square"}} if (color && color !== "") {def.stroke = color} - def["stroke-width"] = t.toFixed(2).replace(/\.?0+$/,""); + def["stroke-width"] = SVG.Fixed(t,2); def.x1 = def.y1 = def.y2 = Math.floor(t/2); def.x2 = Math.floor(w-t/2); if (dash === "dashed") { var n = Math.floor(Math.max(0,w-t)/(6*t)), m = Math.floor(Math.max(0,w-t)/(2*n+1)); @@ -965,7 +983,7 @@ Init: function (h,t,dash,color,def) { if (def == null) {def = {"stroke-linecap":"square"}} if (color && color !== "") {def.stroke = color} - def["stroke-width"] = t.toFixed(2).replace(/\.?0+$/,""); + def["stroke-width"] = SVG.Fixed(t,2); def.x1 = def.x2 = def.y1 = Math.floor(t/2); def.y2 = Math.floor(h-t/2); if (dash === "dashed") { var n = Math.floor(Math.max(0,h-t)/(6*t)), m = Math.floor(Math.max(0,h-t)/(2*n+1)); @@ -1006,21 +1024,31 @@ } }); - var GLYPHS, DEFS; // data for which glyphs are used + var GLYPHS, DEFS, DEFN = 0; // data for which glyphs are used BBOX.GLYPH = BBOX.Subclass({ type: "path", removeable: false, Init: function (scale,id,h,d,w,l,r,p) { var def, t = SVG.config.blacker; - if (!GLYPHS[id]) { - def = {id:id, "stroke-width":t}; + var cache = SVG.config.useFontCache; + var transform = (scale === 1 ? null : "scale("+SVG.Fixed(scale)+")"); + if (!cache || !GLYPHS[id]) { + def = {"stroke-width":t}; + if (cache) { + if (!SVG.config.useGlobalCache) {id = "D"+DEFN+"-"+id} + def.id = id; + } else if (transform) { + def.transform = transform; + } if (p !== "") {def.d = "M"+p+"Z"} this.SUPER(arguments).Init.call(this,def); - DEFS.appendChild(this.element); GLYPHS[id] = true; + if (cache) {DEFS.appendChild(this.element); GLYPHS[id] = true;} + } + if (cache) { + def = {}; if (transform) {def.transform = transform} + this.element = SVG.Element("use",def); + this.element.setAttributeNS(XLINKNS,"href","#"+id); } - def = {}; if (scale !== 1) {def.transform = "scale("+scale+")"} - this.element = SVG.Element("use",def); - this.element.setAttributeNS(XLINKNS,"href","#"+id); this.h = (h+t) * scale; this.d = (d+t) * scale; this.w = (w+t/2) *scale; this.l = (l+t/2) * scale; this.r = (r+t/2) * scale; this.H = Math.max(0,this.h); this.D = Math.max(0,this.d); @@ -1976,6 +2004,14 @@ MML.math.Augment({ SVG: BBOX.Subclass({type:"svg", removeable: false}), toSVG: function (span,div) { + // + // Clear the font cache, if necessary + // + var CONFIG = SVG.config; + if (span && CONFIG.useFontCache && !CONFIG.useGlobalCache) {SVG.clearGlyphs()} + // + // All the data should be in an inferrerd row + // if (this.data[0]) { this.SVGgetStyles(); MML.mbase.prototype.displayAlign = HUB.config.displayAlign; @@ -1990,7 +2026,9 @@ }).With({removeable: false}); box.Add(this.data[0].toSVG(),0,0,true); box.Clean(); this.SVGhandleColor(box); - var svg = this.SVG(); svg.element.setAttribute("xmlns:xlink",XLINKNS); + var svg = this.SVG(); + svg.element.setAttribute("xmlns:xlink",XLINKNS); + if (CONFIG.useFontCache && !CONFIG.useGlobalCache) {svg.element.appendChild(DEFS)} svg.Add(box); svg.Clean(); this.SVGsaveData(svg); // @@ -2013,7 +2051,8 @@ svg.element.setAttribute("height",SVG.Ex(svg.H+svg.D+2*SVG.em)); style.verticalAlign = SVG.Ex(-svg.D-3*SVG.em); // remove 2 extra pixels added below plus padding style.marginLeft = SVG.Ex(-l); style.marginRight = SVG.Ex(-r); - svg.element.setAttribute("viewBox",(-l)+" "+(-svg.H-SVG.em)+" "+(l+svg.w+r)+" "+(svg.H+svg.D+2*SVG.em)); + svg.element.setAttribute("viewBox",SVG.Fixed(-l,1)+" "+SVG.Fixed(-svg.H-SVG.em,1)+" "+ + SVG.Fixed(l+svg.w+r,1)+" "+SVG.Fixed(svg.H+svg.D+2*SVG.em,1)); svg.element.style.margin="1px 0px"; // 1px above and below to prevent lines from touching // // If there is extra height or depth, hide that From 3c98ab81ddede449f42d07de91bf8b5db700ae15 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 17 May 2014 13:47:58 -0400 Subject: [PATCH 04/10] Change where ID is modified so that the cache properly accounts for it. --- unpacked/jax/output/SVG/jax.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index f24f07344..d5f80165d 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -1032,14 +1032,10 @@ var def, t = SVG.config.blacker; var cache = SVG.config.useFontCache; var transform = (scale === 1 ? null : "scale("+SVG.Fixed(scale)+")"); + if (cache && !SVG.config.useGlobalCache) {id = "E"+DEFN+"-"+id} if (!cache || !GLYPHS[id]) { def = {"stroke-width":t}; - if (cache) { - if (!SVG.config.useGlobalCache) {id = "D"+DEFN+"-"+id} - def.id = id; - } else if (transform) { - def.transform = transform; - } + if (cache) {def.id = id} else if (transform) {def.transform = transform} if (p !== "") {def.d = "M"+p+"Z"} this.SUPER(arguments).Init.call(this,def); if (cache) {DEFS.appendChild(this.element); GLYPHS[id] = true;} From b2ce6ef0a0d70e3089037eb51fc3402321ca41de Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 17 May 2014 13:48:44 -0400 Subject: [PATCH 05/10] Make fallback parser clear itself after use, so there isn't an extra element left over at the end (typsetting again causes problems). --- unpacked/jax/input/MathML/jax.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index 46515c6a0..74344e9cc 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -282,8 +282,11 @@ parseDOM: function (string) {return this.parser.parseFromString(string,"text/xml")}, parseMS: function (string) {return (this.parser.loadXML(string) ? this.parser : null)}, parseDIV: function (string) { - this.div.innerHTML = string.replace(/<([a-z]+)([^>]*)\/>/g,"<$1$2>"); - return this.div; + this.div.innerHTML = + "
"+string.replace(/<([a-z]+)([^>]*)\/>/g,"<$1$2>")+"
"; + var doc = this.div.firstChild; + this.div.innerHTML = ""; + return doc; }, parseError: function (string) {return null}, createMSParser: function() { From 11e4ba51019de32dfd9b729ef6067035b65c4af5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 22 May 2014 13:14:29 -0400 Subject: [PATCH 06/10] Make glyph data be part of BBOX.GLYPH, and make sure that resets don't increment the counter for local elements. --- unpacked/jax/output/SVG/jax.js | 45 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index d5f80165d..ba646b569 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -153,8 +153,8 @@ this.textSVG = this.Element("svg"); // Global defs for font glyphs - DEFS = this.addElement(this.addElement(this.hiddenDiv.parentNode,"svg"),"defs",{id:"MathJax_SVG_glyphs"}); - GLYPHS = {}; + BBOX.GLYPH.defs = this.addElement(this.addElement(this.hiddenDiv.parentNode,"svg"), + "defs",{id:"MathJax_SVG_glyphs"}); // Used in preTranslate to get scaling factors this.ExSpan = HTML.Element("span", @@ -298,7 +298,8 @@ // var jax = script.MathJax.elementJax, math = jax.root, span = document.getElementById(jax.inputID+"-Frame"), - div = (jax.SVG.display ? (span||{}).parentNode : span); + div = (jax.SVG.display ? (span||{}).parentNode : span), + localCache = (SVG.config.useFontCache && !SVG.config.useGlobalCache); if (!div) return; // // Set the font metrics @@ -310,10 +311,12 @@ // this.mathDiv = div; span.appendChild(this.textSVG); + if (localCache) {SVG.resetGlyphs()} this.initSVG(math,span); math.setTeXclass(); try {math.toSVG(span,div)} catch (err) { if (err.restart) {while (span.firstChild) {span.removeChild(span.firstChild)}} + if (localCache) {BBOX.GLYPH.n--} throw err; } span.removeChild(this.textSVG); @@ -376,17 +379,18 @@ state.SVGlast = state.SVGeqn; }, - clearGlyphs: function (reset) { + resetGlyphs: function (reset) { if (this.config.useFontCache) { + var GLYPH = BBOX.GLYPH; if (this.config.useGlobalCache) { - DEFS = document.getElementById("MathJax_SVG_Glyphs"); - DEFS.innerHTML = ""; + GLYPH.defs = document.getElementById("MathJax_SVG_Glyphs"); + GLYPH.defs.innerHTML = ""; } else { - DEFS = this.Element("defs"); - DEFN++; + GLYPH.defs = this.Element("defs"); + GLYPH.n++; } - GLYPHS = {}; - if (reset) {DEFN = 0} + GLYPH.glyphs = {}; + if (reset) {GLYPH.n = 0} } }, @@ -1024,21 +1028,19 @@ } }); - var GLYPHS, DEFS, DEFN = 0; // data for which glyphs are used - BBOX.GLYPH = BBOX.Subclass({ type: "path", removeable: false, Init: function (scale,id,h,d,w,l,r,p) { - var def, t = SVG.config.blacker; + var def, t = SVG.config.blacker, GLYPH = BBOX.GLYPH; var cache = SVG.config.useFontCache; var transform = (scale === 1 ? null : "scale("+SVG.Fixed(scale)+")"); - if (cache && !SVG.config.useGlobalCache) {id = "E"+DEFN+"-"+id} - if (!cache || !GLYPHS[id]) { + if (cache && !SVG.config.useGlobalCache) {id = "E"+GLYPH.n+"-"+id} + if (!cache || !GLYPH.glyphs[id]) { def = {"stroke-width":t}; if (cache) {def.id = id} else if (transform) {def.transform = transform} if (p !== "") {def.d = "M"+p+"Z"} this.SUPER(arguments).Init.call(this,def); - if (cache) {DEFS.appendChild(this.element); GLYPHS[id] = true;} + if (cache) {GLYPH.defs.appendChild(this.element); GLYPH.glyphs[id] = true;} } if (cache) { def = {}; if (transform) {def.transform = transform} @@ -1050,6 +1052,10 @@ this.H = Math.max(0,this.h); this.D = Math.max(0,this.d); this.x = this.y = 0; this.scale = scale; } + },{ + glyphs: {}, // which glpyhs have been used + defs: null, // the SVG element where glyphs are stored + n: 0 // the ID for local for self-contained SVG elements }); HUB.Register.StartupHook("mml Jax Ready",function () { @@ -2000,11 +2006,7 @@ MML.math.Augment({ SVG: BBOX.Subclass({type:"svg", removeable: false}), toSVG: function (span,div) { - // - // Clear the font cache, if necessary - // var CONFIG = SVG.config; - if (span && CONFIG.useFontCache && !CONFIG.useGlobalCache) {SVG.clearGlyphs()} // // All the data should be in an inferrerd row // @@ -2024,7 +2026,8 @@ this.SVGhandleColor(box); var svg = this.SVG(); svg.element.setAttribute("xmlns:xlink",XLINKNS); - if (CONFIG.useFontCache && !CONFIG.useGlobalCache) {svg.element.appendChild(DEFS)} + if (CONFIG.useFontCache && !CONFIG.useGlobalCache) + {svg.element.appendChild(BBOX.GLYPH.defs)} svg.Add(box); svg.Clean(); this.SVGsaveData(svg); // From 6dfaf0e464b3036bacb26aaf4b68c6598215b498 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 8 Jun 2014 21:00:01 -0400 Subject: [PATCH 07/10] Add comments --- unpacked/jax/output/SVG/config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unpacked/jax/output/SVG/config.js b/unpacked/jax/output/SVG/config.js index 42dcb0109..f9b360522 100644 --- a/unpacked/jax/output/SVG/config.js +++ b/unpacked/jax/output/SVG/config.js @@ -84,6 +84,10 @@ MathJax.OutputJax.SVG = MathJax.OutputJax({ ".MathJax_SVG .MJX-sans-serif": { "font-family": "sans-serif" }, + + // + // For tooltips + // "#MathJax_SVG_Tooltip": { "background-color": "InfoBackground", color: "InfoText", border: "1px solid black", From f9afa15eccfbd27ef4c272d2035394a3e8960feb Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 8 Jun 2014 21:08:31 -0400 Subject: [PATCH 08/10] Correct ID for global glyph lookup --- unpacked/jax/output/SVG/jax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index ba646b569..31dfabe40 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -383,7 +383,7 @@ if (this.config.useFontCache) { var GLYPH = BBOX.GLYPH; if (this.config.useGlobalCache) { - GLYPH.defs = document.getElementById("MathJax_SVG_Glyphs"); + GLYPH.defs = document.getElementById("MathJax_SVG_glyphs"); GLYPH.defs.innerHTML = ""; } else { GLYPH.defs = this.Element("defs"); From 12313a6629ff0ea358aeb9e59e6bb44bf4246cbc Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 8 Jun 2014 21:09:00 -0400 Subject: [PATCH 09/10] Add missing array in signal data --- unpacked/jax/output/HTML-CSS/jax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 3eb7479da..4e8523d4e 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -522,7 +522,7 @@ if (this.defaultEm) return; var ready = MathJax.Callback(); AJAX.timer.start(AJAX,function (check) { - if (check.time(ready)) {HUB.signal.Post("HTML-CSS Jax - no default em size"); return} + if (check.time(ready)) {HUB.signal.Post(["HTML-CSS Jax - no default em size"]); return} HTMLCSS.getDefaultExEm(); if (HTMLCSS.defaultEm) {ready()} else {setTimeout(check,check.delay)} },this.defaultEmDelay,this.defaultEmTimeout); From d06675ae89806b92880a09b7a438c8b849bc148b Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 24 Jun 2014 16:40:52 -0400 Subject: [PATCH 10/10] Mark SVG spans as MathJax ones properly. --- unpacked/jax/output/SVG/jax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 31dfabe40..be2c38999 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -2059,9 +2059,9 @@ if (svg.H > svg.h || svg.D > svg.d) { var frame = HTML.Element( "span",{style: {display:"inline-block", "white-space":"nowrap", padding:"1px 0px"}, isMathJax:true},[[ - "span",{style: {display:"inline-block", position:"relative", isMathJax:true, + "span",{style: {display:"inline-block", position:"relative", width:SVG.Ex(svg.w), height:SVG.Ex(svg.h+svg.d), - "vertical-align":SVG.Ex(-svg.d)}}]]); + "vertical-align":SVG.Ex(-svg.d)}, isMathJax:true}]]); frame.firstChild.appendChild(svg.element); svg.element = frame; style.verticalAlign = style.margin = ""; style.position = "absolute"; style.bottom = SVG.Ex(svg.d-svg.D); style.left = 0;