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.
pingAnQiYeWeb/public/modules/canvablepath_gj2t4j.js

1 line
5.9 KiB

1 year ago
/**/_jsload2 && _jsload2('canvablepath', 'function hh(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=hh.wW(a);a=hh.trim(a);this.lQ=new function(a){this.tG= a.split(" ");this.reset=function(){this.oh=-1;this.hu=this.lx="";this.start=new hh.Zf(0,0);this.nx=new hh.Zf(0,0);this.jb=new hh.Zf(0,0);this.ha=[];this.Vo=[]};this.KM=function(){return this.oh>=this.tG.length-1};this.Aj=function(){return this.KM()?o:this.tG[this.oh+1].match(/^[A-Za-z]$/)!=p};this.YE=function(){switch(this.lx){case "m":case "l":case "h":case "v":case "c":case "s":case "q":case "t":case "a":case "z":return o}return q};this.pM=function(){this.oh++;return this.tG[this.oh]};this.uj=function(){return parseFloat(this.pM())}; this.IZ=function(){this.hu=this.lx;this.lx=this.pM()};this.Mm=function(){return this.uZ(new hh.Zf(this.uj(),this.uj()))};this.eE=function(){var a=this.Mm();return this.nx=a};this.Bk=function(){var a=this.Mm();return this.jb=a};this.iM=function(){return"c"!=this.hu.toLowerCase()&&"s"!=this.hu.toLowerCase()&&"q"!=this.hu.toLowerCase()&&"t"!=this.hu.toLowerCase()?this.jb:new hh.Zf(2*this.jb.x-this.nx.x,2*this.jb.y-this.nx.y)};this.uZ=function(a){this.YE()&&(a.x+=this.jb.x,a.y+=this.jb.y);return a};this.fj= function(a,b,e){e!=p&&(0<this.Vo.length&&this.Vo[this.Vo.length-1]==p)&&(this.Vo[this.Vo.length-1]=Math.atan2(e.y-this.ha[this.ha.length-1].y,e.x-this.ha[this.ha.length-1].x));this.tC(a,b==p?p:Math.atan2(a.y-b.y,a.x-b.x))};this.tC=function(a,b){this.ha.push(a);this.Vo.push(b)}}(a);this.$a=function(){return this.ni(p)};this.ni=function(a){var c=this.lQ;c.reset();var d=new hh.SP;for(a!=p&&a.beginPath();!c.KM();)switch(c.IZ(),c.lx){case "M":case "m":var e=c.Bk();c.fj(e);d.pg(e.x,e.y);a!=p&&a.moveTo(e.x, e.y);for(c.start=c.jb;!c.Aj();)e=c.Bk(),c.fj(e,c.start),d.pg(e.x,e.y),a!=p&&a.lineTo(e.x,e.y);break;case "L":case "l":for(;!c.Aj();){var f=c.jb,e=c.Bk();c.fj(e,f);d.pg(e.x,e.y);a!=p&&a.lineTo(e.x,e.y)}break;case "H":case "h":for(;!c.Aj();)e=new hh.Zf((c.YE()?c.jb.x:0)+c.uj(),c.jb.y),c.fj(e,c.jb),c.jb=e,d.pg(c.jb.x,c.jb.y),a!=p&&a.lineTo(c.jb.x,c.jb.y);break;case "V":case "v":for(;!c.Aj();)e=new hh.Zf(c.jb.x,(c.YE()?c.jb.y:0)+c.uj()),c.fj(e,c.jb),c.jb=e,d.pg(c.jb.x,c.jb.y),a!=p&&a.lineTo(c.jb.x,c.jb.y); break;case "C":case "c":for(;!c.Aj();){var g=c.jb,f=c.Mm(),i=c.eE(),e=c.Bk();c.fj(e,i,f);d.sC(g.x,g.y,f.x,f.y,i.x,i.y,e.x,e.y);a!=p&&a.bezierCurveTo(f.x,f.y,i.x,i.y,e.x,e.y)}break;case "S":case "s":for(;!c.Aj();)g=c.jb,f=c.iM(),i=c.eE(),e=c.Bk(),c.fj(e,i,f),d.sC(g.x,g.y,f.x,f.y,i.x,i.y,e.x,e.y),a!=p&&a.bezierCurveTo(f.x,f.y,i.x,i.y,e.x,e.y);break;case "Q":case "q":for(;!c.Aj();)g=c.jb,i=c.eE(),e=c.Bk(),c.fj(e,i,i),d.pK(g.x,g.y,i.x,i.y,e.x,e.y),a!=p&&a.quadraticCurveTo(i.x,i.y,e.x,e.y);break;case "T":case "t":for(;!c.Aj();)g= c.jb,i=c.iM(),c.nx=i,e=c.Bk(),c.fj(e,i,i),d.pK(g.x,g.y,i.x,i.y,e.x,e.y),a!=p&&a.quadraticCurveTo(i.x,i.y,e.x,e.y);break;case "A":case "a":for(;!c.Aj();){var g=c.jb,j=c.uj(),l=c.uj(),f=c.uj()*(Math.PI/180),m=c.uj(),i=c.uj(),e=c.Bk(),n=new hh.Zf(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),s=Math.pow(n.x,2)/Math.pow(j,2)+Math.pow(n.y,2)/Math.pow(l,2);1<s&&(j*=Math.sqrt(s),l*=Math.sqrt(s));m=(m==i?-1:1)*Math.sqrt((Math.pow(j,2)*Math.pow(l,2)-Math.pow(j, 2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(j,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(m)&&(m=0);var u=new hh.Zf(m*j*n.y/l,m*-l*n.x/j),g=new hh.Zf((g.x+e.x)/2+Math.cos(f)*u.x-Math.sin(f)*u.y,(g.y+e.y)/2+Math.sin(f)*u.x+Math.cos(f)*u.y),w=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)))},y=function(a,b){return(a[0]*b[1