You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
5.9 KiB

/**/_jsload2&&_jsload2('canvablepath', 'function Dg(a){a=a.replace(/,/gm," ");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\\s])/gm,"$1 $2");a=a.replace(/([^\\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");a=a.replace(/([0-9])([+\\-])/gm,"$1 $2");a=a.replace(/(\\.[0-9]*)(\\.)/gm,"$1 $2");a=a.replace(/([Aa](\\s+[0-9]+){3})\\s+([01])\\s*([01])/gm,"$1 $3 $4 ");a=Dg.KU(a);a=Dg.trim(a);this.FO=new function(a){this.UE= a.split(" ");this.reset=function(){this.ah=-1;this.bt=this.ew="";this.start=new Dg.Vf(0,0);this.fw=new Dg.Vf(0,0);this.lb=new Dg.Vf(0,0);this.na=[];this.ao=[]};this.hL=function(){return this.ah>=this.UE.length-1};this.kj=function(){return this.hL()?p:this.UE[this.ah+1].match(/^[A-Za-z]$/)!=s};this.CD=function(){switch(this.ew){case "m":case "l":case "h":case "v":case "c":case "s":case "q":case "t":case "a":case "z":return p}return t};this.LK=function(){this.ah++;return this.UE[this.ah]};this.fj=function(){return parseFloat(this.LK())}; this.wY=function(){this.bt=this.ew;this.ew=this.LK()};this.$l=function(){return this.iY(new Dg.Vf(this.fj(),this.fj()))};this.IC=function(){var a=this.$l();return this.fw=a};this.hk=function(){var a=this.$l();return this.lb=a};this.BK=function(){return"c"!=this.bt.toLowerCase()&&"s"!=this.bt.toLowerCase()&&"q"!=this.bt.toLowerCase()&&"t"!=this.bt.toLowerCase()?this.lb:new Dg.Vf(2*this.lb.x-this.fw.x,2*this.lb.y-this.fw.y)};this.iY=function(a){this.CD()&&(a.x+=this.lb.x,a.y+=this.lb.y);return a};this.Qi= function(a,b,f){f!=s&&(0<this.ao.length&&this.ao[this.ao.length-1]==s)&&(this.ao[this.ao.length-1]=Math.atan2(f.y-this.na[this.na.length-1].y,f.x-this.na[this.na.length-1].x));this.fB(a,b==s?s:Math.atan2(a.y-b.y,a.x-b.x))};this.fB=function(a,b){this.na.push(a);this.ao.push(b)}}(a);this.fb=function(){return this.Sh(s)};this.Sh=function(a){var c=this.FO;c.reset();var e=new Dg.lO;for(a!=s&&a.beginPath();!c.hL();)switch(c.wY(),c.ew){case "M":case "m":var f=c.hk();c.Qi(f);e.ig(f.x,f.y);a!=s&&a.moveTo(f.x, f.y);for(c.start=c.lb;!c.kj();)f=c.hk(),c.Qi(f,c.start),e.ig(f.x,f.y),a!=s&&a.lineTo(f.x,f.y);break;case "L":case "l":for(;!c.kj();){var g=c.lb,f=c.hk();c.Qi(f,g);e.ig(f.x,f.y);a!=s&&a.lineTo(f.x,f.y)}break;case "H":case "h":for(;!c.kj();)f=new Dg.Vf((c.CD()?c.lb.x:0)+c.fj(),c.lb.y),c.Qi(f,c.lb),c.lb=f,e.ig(c.lb.x,c.lb.y),a!=s&&a.lineTo(c.lb.x,c.lb.y);break;case "V":case "v":for(;!c.kj();)f=new Dg.Vf(c.lb.x,(c.CD()?c.lb.y:0)+c.fj()),c.Qi(f,c.lb),c.lb=f,e.ig(c.lb.x,c.lb.y),a!=s&&a.lineTo(c.lb.x,c.lb.y); break;case "C":case "c":for(;!c.kj();){var i=c.lb,g=c.$l(),k=c.IC(),f=c.hk();c.Qi(f,k,g);e.dB(i.x,i.y,g.x,g.y,k.x,k.y,f.x,f.y);a!=s&&a.bezierCurveTo(g.x,g.y,k.x,k.y,f.x,f.y)}break;case "S":case "s":for(;!c.kj();)i=c.lb,g=c.BK(),k=c.IC(),f=c.hk(),c.Qi(f,k,g),e.dB(i.x,i.y,g.x,g.y,k.x,k.y,f.x,f.y),a!=s&&a.bezierCurveTo(g.x,g.y,k.x,k.y,f.x,f.y);break;case "Q":case "q":for(;!c.kj();)i=c.lb,k=c.IC(),f=c.hk(),c.Qi(f,k,k),e.LI(i.x,i.y,k.x,k.y,f.x,f.y),a!=s&&a.quadraticCurveTo(k.x,k.y,f.x,f.y);break;case "T":case "t":for(;!c.kj();)i= c.lb,k=c.BK(),c.fw=k,f=c.hk(),c.Qi(f,k,k),e.LI(i.x,i.y,k.x,k.y,f.x,f.y),a!=s&&a.quadraticCurveTo(k.x,k.y,f.x,f.y);break;case "A":case "a":for(;!c.kj();){var i=c.lb,m=c.fj(),n=c.fj(),g=c.fj()*(Math.PI/180),o=c.fj(),k=c.fj(),f=c.hk(),q=new Dg.Vf(Math.cos(g)*(i.x-f.x)/2+Math.sin(g)*(i.y-f.y)/2,-Math.sin(g)*(i.x-f.x)/2+Math.cos(g)*(i.y-f.y)/2),v=Math.pow(q.x,2)/Math.pow(m,2)+Math.pow(q.y,2)/Math.pow(n,2);1<v&&(m*=Math.sqrt(v),n*=Math.sqrt(v));o=(o==k?-1:1)*Math.sqrt((Math.pow(m,2)*Math.pow(n,2)-Math.pow(m, 2)*Math.pow(q.y,2)-Math.pow(n,2)*Math.pow(q.x,2))/(Math.pow(m,2)*Math.pow(q.y,2)+Math.pow(n,2)*Math.pow(q.x,2)));isNaN(o)&&(o=0);var w=new Dg.Vf(o*m*q.y/n,o*-n*q.x/m),i=new Dg.Vf((i.x+f.x)/2+Math.cos(g)*w.x-Math.sin(g)*w.y,(i.y+f.y)/2+Math.sin(g)*w.x+Math.cos(g)*w.y),y=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))*Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2)))},A=function(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(y(a,b))},o=A([1,0],[(q.x-w.x)/m,(q.y- w.y)/n]),v=[(q.x-w.x)/m,(q.y-w.y)/n],w=[(-q.x-w.x)/m,(-q.y-w.y)/n],q=A(v,w);-1>=y(v,w)&&(q=Math.PI);1<=y(v,w)&&(q=0);v=1-k?1:-1;w=o+v*(q/2);c.fB(new Dg.Vf(i.x+m*Math.cos(w),i.y+n*Math.sin(w)),w-v*Math.PI/2);c.fB(f,w-v*Math.PI);e.ig(f.x,f.y);a!=s&&(y=m>n?m:n,f=m>n?1:m/n,m=m>n?n/m:1,a.translate(i.x,i.y),a.rotate(g),a.scale(f,m),a.arc(0,0,y,o,o+q,1-k),a.scale(1/f,1/m),a.rotate(-g),a.translate(-i.x,-i.y))}break;case "Z":case "z":a!=s&&a.closePath(),c.lb=c.start}return e}} Dg.trim=function(a){return a.replace(/^\\s+|\\s+$/g,"")};Dg.KU=function(a){return a.replace(/[\\s\\r\\t\\n]+/gm," ")};Dg.Vf=function(a,b){this.x=a;this.y=b}; Dg.lO=function(){this.Sm=this.Rm=this.rj=this.qj=Number.NaN;this.x=x("qj");this.y=x("rj");this.width=function(){return this.Rm-this.qj};this.height=function(){return this.Sm-this.rj};this.ig=function(a,b){if(a!=s){if(isNaN(this.qj)||isNaN(this.Rm))this.Rm=this.qj=a;a<this.qj&&(this.qj=a);a>this.Rm&&(this.Rm=a)}if(b!=s){if(isNaN(this.rj)||isNaN(this.Sm))this.Sm=this.rj=b;b<this.rj&&(this.rj=b);b>this.Sm&&(this.Sm=b)}};this.jB=function(a){this.ig(a,s)};this.kB=function(a){this.ig(s,a)};this.LI=function(a, b,c,e,f,g){c=a+2/3*(c-a);e=b+2/3*(e-b);this.dB(a,b,c,c+1/3*(f-a),e,e+1/3*(g-b),f,g)};this.dB=function(a,b,c,e,f,g,i,k){var m=[a,b],n=[c,e],o=[f,g],q=[i,k];this.ig(m[0],m[1]);this.ig(q[0],q[1]);for(Eg=0;1>=Eg;Eg++)if(a=function(a){return Math.pow(1-a,3)*m[Eg]+3*Math.pow(1-a,2)*a*n[Eg]+3*(1-a)*Math.pow(a,2)*o[Eg]+Math.pow(a,3)*q[Eg]},b=6*m[Eg]-12*n[Eg]+6*o[Eg],c=-3*m[Eg]+9*n[Eg]-9*o[Eg]+3*q[Eg],e=3*n[Eg]-3*m[Eg],0==c)0!=b&&(b=-e/b,0<b&&1>b&&(0==Eg&&this.jB(a(b)),1==Eg&&this.kB(a(b))));else if(e=Math.pow(b, 2)-4*e*c,!(0>e)&&(f=(-b+Math.sqrt(e))/(2*c),0<f&&1>f&&(0==Eg&&this.jB(a(f)),1==Eg&&this.kB(a(f))),b=(-b-Math.sqrt(e))/(2*c),0<b&&1>b))0==Eg&&this.jB(a(b)),1==Eg&&this.kB(a(b))};this.ig(l,l);this.ig(l,l)};D.mO=Dg; ');