diff --git a/dist/docs/assets/js/paper.js b/dist/docs/assets/js/paper.js index 1f83fd85..31ac70b4 100644 --- a/dist/docs/assets/js/paper.js +++ b/dist/docs/assets/js/paper.js @@ -9,7 +9,7 @@ * * All rights reserved. * - * Date: Tue Jan 3 13:23:44 2017 +0100 + * Date: Tue Jan 3 13:39:35 2017 +0100 * *** * @@ -3344,7 +3344,7 @@ new function() { getRotation: function() { var decomposed = this._decompose(); - return decomposed && decomposed.rotation; + return decomposed ? decomposed.rotation : 0; }, setRotation: function(rotation) { @@ -3352,17 +3352,17 @@ new function() { if (current != null && rotation != null) { var decomposed = this._decomposed; this.rotate(rotation - current); - decomposed.rotation = rotation; - this._decomposed = decomposed; + if (decomposed) { + decomposed.rotation = rotation; + this._decomposed = decomposed; + } } }, getScaling: function() { var decomposed = this._decompose(), - scaling = decomposed && decomposed.scaling; - return scaling - ? new LinkedPoint(scaling.x, scaling.y, this, 'setScaling') - : undefined; + s = decomposed && decomposed.scaling; + return new LinkedPoint(s ? s.x : 1, s ? s.y : 1, this, 'setScaling'); }, setScaling: function() { @@ -3371,8 +3371,10 @@ new function() { if (current && scaling && !current.equals(scaling)) { var decomposed = this._decomposed; this.scale(scaling.x / current.x, scaling.y / current.y); - decomposed.scaling = scaling; - this._decomposed = decomposed; + if (decomposed) { + decomposed.scaling = scaling; + this._decomposed = decomposed; + } } }, diff --git a/dist/docs/classes/CompoundPath.html b/dist/docs/classes/CompoundPath.html index c7d47cd0..fe2cad50 100644 --- a/dist/docs/classes/CompoundPath.html +++ b/dist/docs/classes/CompoundPath.html @@ -1127,7 +1127,7 @@ circle.position.x += 100;
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current rotation angle of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only works for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
The current scale factor of the item, as described by its matrix. Please note that this only returns meaningful values for items with applyMatrix set to false
, meaning they do not directly bake transformations into their content.
u.CURVETIME_EPSILON)&&t(s,a,e,n,O,o?z:M,i,r,A,o?M:z)}}}function a(e,i,n,r,s,a){var o=m.intersect(e[0],e[1],e[6],e[7],i[0],i[1],i[6],i[7]);o&&t(s,a,e,n,null,o,i,r,null,o)}return{statics:{_getIntersections:function(i,n,r,o,h,u){if(!n)return k._getSelfIntersection(i,r,h,u);var l=1e-12,f=i[0],d=i[1],_=i[2],g=i[3],v=i[4],p=i[5],m=i[6],y=i[7],w=n[0],x=n[1],b=n[2],C=n[3],S=n[4],P=n[5],I=n[6],M=n[7],T=Math.min,z=Math.max;if(!(z(f,_,v,m)+l>T(w,b,S,I)&&T(f,_,v,m)-l u.CURVETIME_EPSILON)&&t(s,a,e,n,O,o?z:M,i,r,A,o?M:z)}}}function a(e,i,n,r,s,a){var o=m.intersect(e[0],e[1],e[6],e[7],i[0],i[1],i[6],i[7]);o&&t(s,a,e,n,null,o,i,r,null,o)}return{statics:{_getIntersections:function(i,n,r,o,h,u){if(!n)return k._getSelfIntersection(i,r,h,u);var l=1e-12,f=i[0],d=i[1],_=i[2],g=i[3],v=i[4],p=i[5],m=i[6],y=i[7],w=n[0],x=n[1],b=n[2],C=n[3],S=n[4],P=n[5],I=n[6],M=n[7],T=Math.min,z=Math.max;if(!(z(f,_,v,m)+l>T(w,b,S,I)&&T(f,_,v,m)-l =y&&n<=w||n>=w&&n<=y)){var x=n===y?m[0]:n===w?m[6]:1===k.solveCubic(m,1,n,s,0,1)?k.getPoint(m,s[0]).x:(m[0]+m[6])/2;r.push(x)}}}r.length>1&&(r.sort(function(t,e){return t-e}),e.x=(r[0]+r[1])/2)}return e}}});var E=r.extend({_class:"PathFlattener",initialize:function(t,e,i,n,r){function s(t,e){var i=k.getValues(t,e,r);h.push(i),a(i,t._index,0,1)}function a(t,i,r,s){if(!(s-r>c)||n&&k.isStraight(t)||k.isFlatEnough(t,e||.25)){var o=t[6]-t[0],h=t[7]-t[1],f=Math.sqrt(o*o+h*h);f>0&&(l+=f,u.push({offset:l,curve:t,index:i,time:s}))}else{var d=k.subdivide(t,.5),_=(r+s)/2;a(d[0],i,r,_),a(d[1],i,_,s)}}for(var o,h=[],u=[],l=0,c=1/(i||32),f=t._segments,d=f[0],_=1,g=f.length;_ =2&&!t.hasHandles())if(h>2){s=t._closed?"polygon":"polyline";for(var l=[],c=0;cr&&n=s&&(h=h.getNext()),n>=s&&(l=l.getNext()),!(u&&h&&c&&l))return!1;var f=[];a||f.push(u.getLength(),h.getLength()),o||f.push(c.getLength(),l.getLength());var d=this.getPoint(),_=Math.min.apply(Math,f)/64,g=a?h.getTangentAtTime(i):h.getPointAt(_).subtract(d),v=a?g.negate():u.getPointAt(-_).subtract(d),p=o?l.getTangentAtTime(n):l.getPointAt(_).subtract(d),m=o?p.negate():c.getPointAt(-_).subtract(d),y=v.getAngle(),w=g.getAngle(),x=m.getAngle(),b=p.getAngle();return!!(a?t(y,x,b)^t(w,x,b)&&t(y,b,x)^t(w,b,x):t(x,y,w)^t(b,y,w)&&t(x,w,y)^t(b,w,y))},hasOverlap:function(){return!!this._overlap}},r.each(k._evaluateMethods,function(t){var e=t+"At";this[t]=function(){var t=this.getCurve(),i=this.getTime();return null!=i&&t&&t[e](i,!0)}},{preserve:!0}),new function(){function t(t,e,i){function n(i,n){for(var s=i+n;s>=-1&&s<=r;s+=n){var a=t[(s%r+r)%r];if(!e.getPoint().isClose(a.getPoint(),1e-7))break;if(e.equals(a))return a}return null}for(var r=t.length,s=0,a=r-1;s<=a;){var o,h=s+a>>>1,u=t[h];if(i&&(o=e.equals(u)?u:n(h,-1)||n(h,1)))return e._overlap&&(o._overlap=o._intersection._overlap=!0),o;var l=e.getPath(),c=u.getPath(),f=l!==c?l._id-c._id:e.getIndex()+e.getTime()-(u.getIndex()+u.getTime());f<0?a=h-1:s=h+1}return t.splice(s,0,e),e}return{statics:{insert:t,expand:function(e){for(var i=e.slice(),n=e.length-1;n>=0;n--)t(i,e[n]._intersection,!1);return i}}}}),A=w.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;if(r.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i){var s=i[0];n=s&&Array.isArray(s[0])}else e&&(n=(e.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(e));var a=n?N:L;return new a(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){function e(t,e){var i=+n[t];return o&&(i+=h[e]),i}function i(t){return new c(e(t,"x"),e(t+1,"y"))}var n,r,s,a=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),o=!1,h=new c,u=new c;this.clear();for(var l=0,f=a&&a.length;lr:nr&&n=s&&(h=h.getNext()),n>=s&&(l=l.getNext()),!(u&&h&&c&&l))return!1;var f=[];a||f.push(u.getLength(),h.getLength()),o||f.push(c.getLength(),l.getLength());var d=this.getPoint(),_=Math.min.apply(Math,f)/64,g=a?h.getTangentAtTime(i):h.getPointAt(_).subtract(d),v=a?g.negate():u.getPointAt(-_).subtract(d),p=o?l.getTangentAtTime(n):l.getPointAt(_).subtract(d),m=o?p.negate():c.getPointAt(-_).subtract(d),y=v.getAngle(),w=g.getAngle(),x=m.getAngle(),b=p.getAngle();return!!(a?t(y,x,b)^t(w,x,b)&&t(y,b,x)^t(w,b,x):t(x,y,w)^t(b,y,w)&&t(x,w,y)^t(b,w,y))},hasOverlap:function(){return!!this._overlap}},r.each(k._evaluateMethods,function(t){var e=t+"At";this[t]=function(){var t=this.getCurve(),i=this.getTime();return null!=i&&t&&t[e](i,!0)}},{preserve:!0}),new function(){function t(t,e,i){function n(i,n){for(var s=i+n;s>=-1&&s<=r;s+=n){var a=t[(s%r+r)%r];if(!e.getPoint().isClose(a.getPoint(),1e-7))break;if(e.equals(a))return a}return null}for(var r=t.length,s=0,a=r-1;s<=a;){var o,h=s+a>>>1,u=t[h];if(i&&(o=e.equals(u)?u:n(h,-1)||n(h,1)))return e._overlap&&(o._overlap=o._intersection._overlap=!0),o;var l=e.getPath(),c=u.getPath(),f=l!==c?l._id-c._id:e.getIndex()+e.getTime()-(u.getIndex()+u.getTime());f<0?a=h-1:s=h+1}return t.splice(s,0,e),e}return{statics:{insert:t,expand:function(e){for(var i=e.slice(),n=e.length-1;n>=0;n--)t(i,e[n]._intersection,!1);return i}}}}),A=w.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;if(r.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i){var s=i[0];n=s&&Array.isArray(s[0])}else e&&(n=(e.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(e));var a=n?N:L;return new a(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){function e(t,e){var i=+n[t];return o&&(i+=h[e]),i}function i(t){return new c(e(t,"x"),e(t+1,"y"))}var n,r,s,a=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),o=!1,h=new c,u=new c;this.clear();for(var l=0,f=a&&a.length;l=s&&(s=u,r=a)}return{error:s,index:r}}}),D=w.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var i=t&&r.isPlainObject(t)&&t.x===e&&t.y===e;this._initialize(i&&t,!i&&c.read(arguments))},_equals:function(t){return this._content===t._content},copyContent:function(t){this.setContent(t._content)},getContent:function(){return this._content},setContent:function(t){this._content=""+t,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(265)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),j=D.extend({_class:"PointText",initialize:function(){D.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new f(t.x,t.y,this,"setPoint")},setPoint:function(){var t=c.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,e,i){if(this._content){this._setStyles(t,e,i);var n=this._lines,r=this._style,s=r.hasFill(),a=r.hasStroke(),o=r.getLeading(),h=t.shadowColor;t.font=r.getFontStyle(),t.textAlign=r.getJustification();for(var u=0,l=n.length;us?u:s,_=l>a?l:a,g=c>o?c:o},difference:function(){d=u-s,d<0&&(d=-d),_=l-a,_<0&&(_=-_),g=c-o,g<0&&(g=-g)},exclusion:function(){d=u+s*(255-u-u)/255,_=l+a*(255-l-l)/255,g=c+o*(255-c-c)/255},hue:function(){n(s,a,o,i(u,l,c)),e(d,_,g,t(u,l,c))},saturation:function(){n(u,l,c,i(s,a,o)),e(d,_,g,t(u,l,c))},luminosity:function(){e(u,l,c,t(s,a,o))},color:function(){e(s,a,o,t(u,l,c))},add:function(){d=v(u+s,255),_=v(l+a,255),g=v(c+o,255)},subtract:function(){d=p(u-s,0),_=p(l-a,0),g=p(c-o,0)},average:function(){d=(u+s)/2,_=(l+a)/2,g=(c+o)/2},negation:function(){d=255-m(255-s-u),_=255-m(255-a-l),g=255-m(255-o-c)}},w=this.nativeModes=r.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(t){this[t]=!0},{}),x=Q.getContext(1,1);x&&(r.each(y,function(t,e){var i="darken"===e,n=!1;x.save();try{x.fillStyle=i?"#300":"#a00",x.fillRect(0,0,1,1),x.globalCompositeOperation=e,x.globalCompositeOperation===e&&(x.fillStyle=i?"#a00":"#300",x.fillRect(0,0,1,1),n=x.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(r){}x.restore(),w[e]=n}),Q.release(x)),this.process=function(t,e,i,n,r){var v=e.canvas,p="normal"===t;if(p||w[t])i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=n,p||(i.globalCompositeOperation=t),i.drawImage(v,r.x,r.y),i.restore();else{var m=y[t];if(!m)return;for(var x=i.getImageData(r.x,r.y,v.width,v.height),b=x.data,C=e.getImageData(0,0,v.width,v.height).data,S=0,P=b.length;S0){var s=e[r],a=s&&s[i];a&&a.call(this,r)}},statics:{inject:function st(t){var e=t._events;if(e){var n={};r.each(e,function(e,i){var s="string"==typeof e,a=s?e:i,o=r.capitalize(a),h=a.substring(2).toLowerCase();n[h]=s?{}:e,a="_"+a,t["get"+o]=function(){return this[a]},t["set"+o]=function(t){var e=this[a];e&&this.off(h,e),t&&this.on(h,t),this[a]=t}}),t._eventTypes=n}return st.base.apply(this,arguments)}}},a=r.extend({_class:"PaperScope",initialize:function at(){paper=this,this.settings=new r({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this.palettes=[],this._id=at._id++,at._scopes[this._id]=this;var e=at.prototype;if(!this.support){var n=tt.getContext(1,1)||{};e.support={nativeDash:"setLineDash"in n||"mozDash"in n,nativeBlendModes:et.nativeModes},tt.release(n)}if(!this.agent){var i=t.navigator.userAgent.toLowerCase(),s=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(i)||[])[0],a="darwin"===s?"mac":s,o=e.agent=e.browser={platform:a};a&&(o[a]=!0),i.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(t,e,n,i,r){if(!o.chrome){var s="opera"===e?i:/^(node|trident)$/.test(e)?r:n;o.version=s,o.versionNumber=parseFloat(s),e="trident"===e?"msie":e,o.name=e,o[e]=!0}}),o.chrome&&delete o.webkit,o.atom&&delete o.chrome}},version:"0.10.2-develop",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,e){paper.PaperScript.execute(t,this,e),Z.updateFocus()},install:function(t){var e=this;r.each(["project","view","tool"],function(n){r.define(t,n,{configurable:!0,get:function(){return e[n]}})});for(var n in this)!/^_/.test(n)&&this[n]&&(t[n]=this[n])},setup:function(t){return paper=this,this.project=new y(t),this},createCanvas:function(t,e){return tt.getCanvas(t,e)},activate:function(){paper=this},clear:function(){for(var t=this.projects,e=this.tools,n=this.palettes,i=t.length-1;i>=0;i--)t[i].remove();for(var i=e.length-1;i>=0;i--)e[i].remove();for(var i=n.length-1;i>=0;i--)n[i].remove()},remove:function(){this.clear(),delete a._scopes[this._id]},statics:new function(){function t(t){return t+="Attribute",function(e,n){return e[t](n)||e[t]("data-paper-"+n)}}return{_scopes:{},_id:0,get:function(t){return this._scopes[t]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),o=r.extend(s,{initialize:function(t){this._scope=paper,this._index=this._scope[this._list].push(this)-1,!t&&this._scope[this._reference]||this.activate()},activate:function(){if(!this._scope)return!1;var t=this._scope[this._reference];return t&&t!==this&&t.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",t),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(r.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),h=r.extend({initialize:function(t){this.precision=r.pick(t,5),this.multiplier=Math.pow(10,this.precision)},number:function(t){return this.precision<16?Math.round(t*this.multiplier)/this.multiplier:t},pair:function(t,e,n){return this.number(t)+(n||",")+this.number(e)},point:function(t,e){return this.number(t.x)+(e||",")+this.number(t.y)},size:function(t,e){return this.number(t.width)+(e||",")+this.number(t.height)},rectangle:function(t,e){return this.point(t,e)+(e||",")+this.size(t,e)}});h.instance=new h;var u=new function(){function t(t,e,n){return tr:ir&&i=s&&(h=h.getNext()),i>=s&&(l=l.getNext()),!(u&&h&&c&&l))return!1;var f=[];a||f.push(u.getLength(),h.getLength()),o||f.push(c.getLength(),l.getLength());var d=this.getPoint(),_=Math.min.apply(Math,f)/64,g=a?h.getTangentAtTime(n):h.getPointAt(_).subtract(d),v=a?g.negate():u.getPointAt(-_).subtract(d),p=o?l.getTangentAtTime(i):l.getPointAt(_).subtract(d),m=o?p.negate():c.getPointAt(-_).subtract(d),y=v.getAngle(),w=g.getAngle(),x=m.getAngle(),b=p.getAngle();return!!(a?t(y,x,b)^t(w,x,b)&&t(y,b,x)^t(w,b,x):t(x,y,w)^t(b,y,w)&&t(x,w,y)^t(b,w,y))},hasOverlap:function(){return!!this._overlap}},r.each(T._evaluateMethods,function(t){var e=t+"At";this[t]=function(){var t=this.getCurve(),n=this.getTime();return null!=n&&t&&t[e](n,!0)}},{preserve:!0}),new function(){function t(t,e,n){function i(n,i){for(var s=n+i;s>=-1&&s<=r;s+=i){var a=t[(s%r+r)%r];if(!e.getPoint().isClose(a.getPoint(),1e-7))break;if(e.equals(a))return a}return null}for(var r=t.length,s=0,a=r-1;s<=a;){var o,h=s+a>>>1,u=t[h];if(n&&(o=e.equals(u)?u:i(h,-1)||i(h,1)))return e._overlap&&(o._overlap=o._intersection._overlap=!0),o;var l=e.getPath(),c=u.getPath(),f=l!==c?l._id-c._id:e.getIndex()+e.getTime()-(u.getIndex()+u.getTime());f<0?a=h-1:s=h+1}return t.splice(s,0,e),e}return{statics:{insert:t,expand:function(e){for(var n=e.slice(),i=e.length-1;i>=0;i--)t(n,e[i]._intersection,!1);return n}}}}),O=w.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,n,i;if(r.isPlainObject(t)?(n=t.segments,e=t.pathData):Array.isArray(t)?n=t:"string"==typeof t&&(e=t),n){var s=n[0];i=s&&Array.isArray(s[0])}else e&&(i=(e.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(e));var a=i?E:L;return new a(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){function e(t,e){var n=+i[t];return o&&(n+=h[e]),n}function n(t){return new c(e(t,"x"),e(t+1,"y"))}var i,r,s,a=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),o=!1,h=new c,u=new c;this.clear();for(var l=0,f=a&&a.length;lr:i