1
2
3
4
5
6
7
8
| //>>built
| define("dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/Color ./_base ./svg ./matrix".split(" "),function(n,h,k,l,f,d,p){function q(a){var c=a.rawNode.getAttribute("fill");if("none"==c)a.fillStyle=null;else{var b=null,e=d.getRef(c);if(e)switch(e.tagName.toLowerCase()){case "lineargradient":b=m(f.defaultLinearGradient,e);k.forEach(["x1","y1","x2","y2"],function(a){b[a]=e.getAttribute(a)});break;case "radialgradient":b=m(f.defaultRadialGradient,e);k.forEach(["cx","cy","r"],function(a){b[a]=
| e.getAttribute(a)});b.cx=e.getAttribute("cx");b.cy=e.getAttribute("cy");b.r=e.getAttribute("r");break;case "pattern":b=h.clone(f.defaultPattern),k.forEach(["x","y","width","height"],function(a){b[a]=e.getAttribute(a)}),b.src=e.firstChild.getAttributeNS(d.xmlns.xlink,"href")}else b=new l(c),c=a.rawNode.getAttribute("fill-opacity"),null!=c&&(b.a=c);a.fillStyle=b}}function m(a,c){a=h.clone(a);a.colors=[];for(var b=0;b<c.childNodes.length;++b)a.colors.push({offset:c.childNodes[b].getAttribute("offset"),
| color:new l(c.childNodes[b].getAttribute("stop-color"))});return a}function g(a,c){c=a.shape=h.clone(c);a=a.rawNode;for(var b in c)c[b]=a.getAttribute(b)}n.experimental("dojox.gfx.svg_attach");d.attachNode=function(a){if(!a)return null;var c=null;switch(a.tagName.toLowerCase()){case d.Rect.nodeType:a=c=new d.Rect(a);g(a,f.defaultRect);a.shape.r=Math.min(a.rawNode.getAttribute("rx"),a.rawNode.getAttribute("ry"));break;case d.Ellipse.nodeType:c=new d.Ellipse(a);g(c,f.defaultEllipse);break;case d.Polyline.nodeType:c=
| new d.Polyline(a);g(c,f.defaultPolyline);break;case d.Path.nodeType:c=new d.Path(a);g(c,f.defaultPath);break;case d.Circle.nodeType:c=new d.Circle(a);g(c,f.defaultCircle);break;case d.Line.nodeType:c=new d.Line(a);g(c,f.defaultLine);break;case d.Image.nodeType:c=new d.Image(a);g(c,f.defaultImage);break;case d.Text.nodeType:if((c=a.getElementsByTagName("textPath"))&&c.length){c=new d.TextPath(a);g(c,f.defaultPath);var b=c;a=b.shape=h.clone(f.defaultTextPath);b=b.rawNode}else b=c=new d.Text(a),a=b.shape=
| h.clone(f.defaultText),b=b.rawNode,a.x=b.getAttribute("x"),a.y=b.getAttribute("y");a.align=b.getAttribute("text-anchor");a.decoration=b.getAttribute("text-decoration");a.rotated=0!=parseFloat(b.getAttribute("rotate"));a.kerning="auto"==b.getAttribute("kerning");a.text=b.firstChild.nodeValue;b=c;a=b.fontStyle=h.clone(f.defaultFont);b=b.rawNode;a.style=b.getAttribute("font-style");a.variant=b.getAttribute("font-variant");a.weight=b.getAttribute("font-weight");a.size=b.getAttribute("font-size");a.family=
| b.getAttribute("font-family");break;default:return null}if(!(c instanceof d.Image)){q(c);var e=c;a=e.rawNode;b=a.getAttribute("stroke");null==b||"none"==b?e.strokeStyle=null:(e=e.strokeStyle=h.clone(f.defaultStroke),b=new l(b),e.color=b,e.color.a=a.getAttribute("stroke-opacity"),e.width=a.getAttribute("stroke-width"),e.cap=a.getAttribute("stroke-linecap"),e.join=a.getAttribute("stroke-linejoin"),"miter"==e.join&&(e.join=a.getAttribute("stroke-miterlimit")),e.style=a.getAttribute("dojoGfxStrokeStyle"))}a=
| c;b=a.rawNode.getAttribute("transform");b.match(/^matrix\(.+\)$/)?(b=b.slice(7,-1).split(","),a.matrix=p.normalize({xx:parseFloat(b[0]),xy:parseFloat(b[2]),yx:parseFloat(b[1]),yy:parseFloat(b[3]),dx:parseFloat(b[4]),dy:parseFloat(b[5])})):a.matrix=null;return c};d.attachSurface=function(a){var c=new d.Surface;c.rawNode=a;a=a.getElementsByTagName("defs");if(0==a.length)return null;c.defNode=a[0];return c};return d});
|
|