commit 4c85dc09b9bfa3c2ed54ab95f92748d5fffe5cae
parent c68c6904682b01bdf54aba68cf0b76688445d602
Author: Davide P. Cervone <dpvc@union.edu>
Date: Sat, 17 Oct 2015 06:01:15 -0400
Make mactions nest properly in SVG output
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/unpacked/jax/output/SVG/autoload/maction.js b/unpacked/jax/output/SVG/autoload/maction.js
@@ -49,6 +49,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
var selected = this.selected();
if (selected.type == "null") {this.SVGsaveData(svg);return svg;}
svg.Add(this.SVGdataStretched(this.Get("selection")-1,HW,D));
+ svg.removeable = false;
this.SVGhandleHitBox(svg);
this.SVGhandleSpace(svg);
this.SVGhandleColor(svg);
@@ -56,10 +57,12 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
return svg;
},
SVGhandleHitBox: function (svg) {
- var frame = SVG.addElement(svg.element,"rect",
+ var frame = SVG.Element("rect",
{width:svg.w, height:svg.h+svg.d, y:-svg.d, fill:"none", "pointer-events":"all"});
+ svg.element.insertBefore(frame,svg.element.firstChild);
var type = this.Get("actiontype");
- if (this.SVGaction[type]) {this.SVGaction[type].call(this,svg,frame,this.Get("selection"))}
+ if (this.SVGaction[type])
+ {this.SVGaction[type].call(this,svg,svg.element,this.Get("selection"))}
},
SVGstretchH: MML.mbase.prototype.SVGstretchH,
SVGstretchV: MML.mbase.prototype.SVGstretchV,