1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
|
document.createElement("canvas").getContext||!function(){function a(){return this.context_||(this.context_=new u(this))}function b(a,b,c){var d=O.call(arguments,2);return function(){return a.apply(b,d.concat(O.call(arguments)))}}function c(a){return String(a).replace(/&/g,"&").replace(/"/g,""")}function d(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function e(a){if(d(a,"g_vml_","urn:schemas-microsoft-com:vml"),d(a,"g_o_","urn:schemas-microsoft-com:office:office"),!a.styleSheets.ex_canvas_){var b=a.createStyleSheet();b.owningElement.id="ex_canvas_",b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function f(a){var b=a.srcElement;switch(a.propertyName){case"width":b.getContext().clearRect(),b.style.width=b.attributes.width.nodeValue+"px",b.firstChild.style.width=b.clientWidth+"px";break;case"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+"px"}}function g(a){var b=a.srcElement;b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px",b.firstChild.style.height=b.clientHeight+"px")}function h(){return[[1,0,0],[0,1,0],[0,0,1]]}function i(a,b){for(var c=h(),d=0;3>d;d++)for(var e=0;3>e;e++){for(var f=0,g=0;3>g;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}function j(a,b){b.fillStyle=a.fillStyle,b.lineCap=a.lineCap,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.shadowBlur=a.shadowBlur,b.shadowColor=a.shadowColor,b.shadowOffsetX=a.shadowOffsetX,b.shadowOffsetY=a.shadowOffsetY,b.strokeStyle=a.strokeStyle,b.globalAlpha=a.globalAlpha,b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,b.arcScaleX_=a.arcScaleX_,b.arcScaleY_=a.arcScaleY_,b.lineScale_=a.lineScale_}function k(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),d=a.substring(b+1,c).split(",");return(4!=d.length||"a"!=a.charAt(3))&&(d[3]=1),d}function l(a){return parseFloat(a)/100}function m(a,b,c){return Math.min(c,Math.max(b,a))}function n(a){var b,c,d,e,f,g;if(e=parseFloat(a[0])/360%360,0>e&&e++,f=m(l(a[1]),0,1),g=m(l(a[2]),0,1),0==f)b=c=d=g;else{var h=.5>g?g*(1+f):g+f-g*f,i=2*g-h;b=o(i,h,e+1/3),c=o(i,h,e),d=o(i,h,e-1/3)}return"#"+Q[Math.floor(255*b)]+Q[Math.floor(255*c)]+Q[Math.floor(255*d)]}function o(a,b,c){return 0>c&&c++,c>1&&c--,1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a}function p(a){if(a in U)return U[a];var b,c=1;if(a=String(a),"#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){for(var d,e=k(a),b="#",f=0;3>f;f++)d=-1!=e[f].indexOf("%")?Math.floor(255*l(e[f])):+e[f],b+=Q[m(d,0,255)];c=+e[3]}else if(/^hsl/.test(a)){var e=k(a);b=n(e),c=e[3]}else b=T[a]||a;return U[a]={color:b,alpha:c}}function q(a){if(W[a])return W[a];var b=document.createElement("div"),c=b.style;try{c.font=a}catch(d){}return W[a]={style:c.fontStyle||V.style,variant:c.fontVariant||V.variant,weight:c.fontWeight||V.weight,size:c.fontSize||V.size,family:c.fontFamily||V.family}}function r(a,b){var c={};for(var d in a)c[d]=a[d];var e=parseFloat(b.currentStyle.fontSize),f=parseFloat(a.size);return"number"==typeof a.size?c.size=a.size:-1!=a.size.indexOf("px")?c.size=f:-1!=a.size.indexOf("em")?c.size=e*f:-1!=a.size.indexOf("%")?c.size=e/100*f:-1!=a.size.indexOf("pt")?c.size=f/.75:c.size=e,c.size*=.981,c}function s(a){return a.style+" "+a.variant+" "+a.weight+" "+a.size+"px "+a.family}function t(a){return X[a]||"square"}function u(a){this.m_=h(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=1*M,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b,a.appendChild(c);var d=c.cloneNode(!1);d.style.backgroundColor="red",d.style.filter="alpha(opacity=0)",a.appendChild(d),this.element_=c,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function v(a,b,c,d){a.currentPath_.push({type:"b
|