Mercurial > hg > STI-GWT
comparison war/scripts/excanvas.js @ 3:cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
git-svn-id: http://dev.dariah.eu/svn/repos/eu.dariah.de/ap1/sti-gwt-dariah-geobrowser@36 f2b5be40-def6-11e0-8a09-b3c1cc336c6b
author | StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b> |
---|---|
date | Tue, 17 Jul 2012 13:34:40 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:2897af43ccc6 | 3:cf06b77a8bbd |
---|---|
1 if(!document.createElement("canvas").getContext){ | |
2 (function(){ | |
3 var m=Math; | |
4 var mr=m.round; | |
5 var ms=m.sin; | |
6 var mc=m.cos; | |
7 var _5=m.abs; | |
8 var _6=m.sqrt; | |
9 var Z=10; | |
10 var Z2=Z/2; | |
11 function getContext(){ | |
12 return this.context_||(this.context_=new CanvasRenderingContext2D_(this)); | |
13 }; | |
14 var _9=Array.prototype.slice; | |
15 function bind(f,_b,_c){ | |
16 var a=_9.call(arguments,2); | |
17 return function(){ | |
18 return f.apply(_b,a.concat(_9.call(arguments))); | |
19 }; | |
20 }; | |
21 var _e={init:function(_f){ | |
22 if(/MSIE/.test(navigator.userAgent)&&!window.opera){ | |
23 var doc=_f||document; | |
24 doc.createElement("canvas"); | |
25 doc.attachEvent("onreadystatechange",bind(this.init_,this,doc)); | |
26 } | |
27 },init_:function(doc){ | |
28 if(!doc.namespaces["g_vml_"]){ | |
29 doc.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML"); | |
30 } | |
31 if(!doc.namespaces["g_o_"]){ | |
32 doc.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML"); | |
33 } | |
34 if(!doc.styleSheets["ex_canvas_"]){ | |
35 var ss=doc.createStyleSheet(); | |
36 ss.owningElement.id="ex_canvas_"; | |
37 ss.cssText="canvas{display:inline-block;overflow:hidden;"+"text-align:left;width:300px;height:150px}"+"g_vml_\\:*{behavior:url(#default#VML)}"+"g_o_\\:*{behavior:url(#default#VML)}"; | |
38 } | |
39 var els=doc.getElementsByTagName("canvas"); | |
40 for(var i=0;i<els.length;i++){ | |
41 this.initElement(els[i]); | |
42 } | |
43 },initElement:function(el){ | |
44 if(!el.getContext){ | |
45 el.getContext=getContext; | |
46 el.innerHTML=""; | |
47 el.attachEvent("onpropertychange",onPropertyChange); | |
48 el.attachEvent("onresize",onResize); | |
49 var _16=el.attributes; | |
50 if(_16.width&&_16.width.specified){ | |
51 el.style.width=_16.width.nodeValue+"px"; | |
52 }else{ | |
53 el.width=el.clientWidth; | |
54 } | |
55 if(_16.height&&_16.height.specified){ | |
56 el.style.height=_16.height.nodeValue+"px"; | |
57 }else{ | |
58 el.height=el.clientHeight; | |
59 } | |
60 } | |
61 return el; | |
62 }}; | |
63 function onPropertyChange(e){ | |
64 var el=e.srcElement; | |
65 switch(e.propertyName){ | |
66 case "width": | |
67 el.style.width=el.attributes.width.nodeValue+"px"; | |
68 el.getContext().clearRect(); | |
69 break; | |
70 case "height": | |
71 el.style.height=el.attributes.height.nodeValue+"px"; | |
72 el.getContext().clearRect(); | |
73 break; | |
74 } | |
75 }; | |
76 function onResize(e){ | |
77 var el=e.srcElement; | |
78 if(el.firstChild){ | |
79 el.firstChild.style.width=el.clientWidth+"px"; | |
80 el.firstChild.style.height=el.clientHeight+"px"; | |
81 } | |
82 }; | |
83 _e.init(); | |
84 var _1b=[]; | |
85 for(var i=0;i<16;i++){ | |
86 for(var j=0;j<16;j++){ | |
87 _1b[i*16+j]=i.toString(16)+j.toString(16); | |
88 } | |
89 } | |
90 function createMatrixIdentity(){ | |
91 return [[1,0,0],[0,1,0],[0,0,1]]; | |
92 }; | |
93 function matrixMultiply(m1,m2){ | |
94 var _20=createMatrixIdentity(); | |
95 for(var x=0;x<3;x++){ | |
96 for(var y=0;y<3;y++){ | |
97 var sum=0; | |
98 for(var z=0;z<3;z++){ | |
99 sum+=m1[x][z]*m2[z][y]; | |
100 } | |
101 _20[x][y]=sum; | |
102 } | |
103 } | |
104 return _20; | |
105 }; | |
106 function copyState(o1,o2){ | |
107 o2.fillStyle=o1.fillStyle; | |
108 o2.lineCap=o1.lineCap; | |
109 o2.lineJoin=o1.lineJoin; | |
110 o2.lineWidth=o1.lineWidth; | |
111 o2.miterLimit=o1.miterLimit; | |
112 o2.shadowBlur=o1.shadowBlur; | |
113 o2.shadowColor=o1.shadowColor; | |
114 o2.shadowOffsetX=o1.shadowOffsetX; | |
115 o2.shadowOffsetY=o1.shadowOffsetY; | |
116 o2.strokeStyle=o1.strokeStyle; | |
117 o2.globalAlpha=o1.globalAlpha; | |
118 o2.arcScaleX_=o1.arcScaleX_; | |
119 o2.arcScaleY_=o1.arcScaleY_; | |
120 o2.lineScale_=o1.lineScale_; | |
121 }; | |
122 function processStyle(_27){ | |
123 var str,_29=1; | |
124 _27=String(_27); | |
125 if(_27.substring(0,3)=="rgb"){ | |
126 var _2a=_27.indexOf("(",3); | |
127 var end=_27.indexOf(")",_2a+1); | |
128 var _2c=_27.substring(_2a+1,end).split(","); | |
129 str="#"; | |
130 for(var i=0;i<3;i++){ | |
131 str+=_1b[Number(_2c[i])]; | |
132 } | |
133 if(_2c.length==4&&_27.substr(3,1)=="a"){ | |
134 _29=_2c[3]; | |
135 } | |
136 }else{ | |
137 str=_27; | |
138 } | |
139 return {color:str,alpha:_29}; | |
140 }; | |
141 function processLineCap(_2e){ | |
142 switch(_2e){ | |
143 case "butt": | |
144 return "flat"; | |
145 case "round": | |
146 return "round"; | |
147 case "square": | |
148 default: | |
149 return "square"; | |
150 } | |
151 }; | |
152 function CanvasRenderingContext2D_(_2f){ | |
153 this.m_=createMatrixIdentity(); | |
154 this.mStack_=[]; | |
155 this.aStack_=[]; | |
156 this.currentPath_=[]; | |
157 this.strokeStyle="#000"; | |
158 this.fillStyle="#000"; | |
159 this.lineWidth=1; | |
160 this.lineJoin="miter"; | |
161 this.lineCap="butt"; | |
162 this.miterLimit=Z*1; | |
163 this.globalAlpha=1; | |
164 this.canvas=_2f; | |
165 var el=_2f.ownerDocument.createElement("div"); | |
166 el.style.width=_2f.clientWidth+"px"; | |
167 el.style.height=_2f.clientHeight+"px"; | |
168 el.style.overflow="hidden"; | |
169 el.style.position="absolute"; | |
170 _2f.appendChild(el); | |
171 this.element_=el; | |
172 this.arcScaleX_=1; | |
173 this.arcScaleY_=1; | |
174 this.lineScale_=1; | |
175 }; | |
176 var _31=CanvasRenderingContext2D_.prototype; | |
177 _31.clearRect=function(){ | |
178 this.element_.innerHTML=""; | |
179 }; | |
180 _31.beginPath=function(){ | |
181 this.currentPath_=[]; | |
182 }; | |
183 _31.moveTo=function(aX,aY){ | |
184 var p=this.getCoords_(aX,aY); | |
185 this.currentPath_.push({type:"moveTo",x:p.x,y:p.y}); | |
186 this.currentX_=p.x; | |
187 this.currentY_=p.y; | |
188 }; | |
189 _31.lineTo=function(aX,aY){ | |
190 var p=this.getCoords_(aX,aY); | |
191 this.currentPath_.push({type:"lineTo",x:p.x,y:p.y}); | |
192 this.currentX_=p.x; | |
193 this.currentY_=p.y; | |
194 }; | |
195 _31.bezierCurveTo=function(_38,_39,_3a,_3b,aX,aY){ | |
196 var p=this.getCoords_(aX,aY); | |
197 var cp1=this.getCoords_(_38,_39); | |
198 var cp2=this.getCoords_(_3a,_3b); | |
199 bezierCurveTo(this,cp1,cp2,p); | |
200 }; | |
201 function bezierCurveTo(_41,cp1,cp2,p){ | |
202 _41.currentPath_.push({type:"bezierCurveTo",cp1x:cp1.x,cp1y:cp1.y,cp2x:cp2.x,cp2y:cp2.y,x:p.x,y:p.y}); | |
203 _41.currentX_=p.x; | |
204 _41.currentY_=p.y; | |
205 }; | |
206 _31.quadraticCurveTo=function(_45,_46,aX,aY){ | |
207 var cp=this.getCoords_(_45,_46); | |
208 var p=this.getCoords_(aX,aY); | |
209 var cp1={x:this.currentX_+2/3*(cp.x-this.currentX_),y:this.currentY_+2/3*(cp.y-this.currentY_)}; | |
210 var cp2={x:cp1.x+(p.x-this.currentX_)/3,y:cp1.y+(p.y-this.currentY_)/3}; | |
211 bezierCurveTo(this,cp1,cp2,p); | |
212 }; | |
213 _31.arc=function(aX,aY,_4f,_50,_51,_52){ | |
214 _4f*=Z; | |
215 var _53=_52?"at":"wa"; | |
216 var _54=aX+mc(_50)*_4f-Z2; | |
217 var _55=aY+ms(_50)*_4f-Z2; | |
218 var _56=aX+mc(_51)*_4f-Z2; | |
219 var _57=aY+ms(_51)*_4f-Z2; | |
220 if(_54==_56&&!_52){ | |
221 _54+=0.125; | |
222 } | |
223 var p=this.getCoords_(aX,aY); | |
224 var _59=this.getCoords_(_54,_55); | |
225 var _5a=this.getCoords_(_56,_57); | |
226 this.currentPath_.push({type:_53,x:p.x,y:p.y,radius:_4f,xStart:_59.x,yStart:_59.y,xEnd:_5a.x,yEnd:_5a.y}); | |
227 }; | |
228 _31.rect=function(aX,aY,_5d,_5e){ | |
229 this.moveTo(aX,aY); | |
230 this.lineTo(aX+_5d,aY); | |
231 this.lineTo(aX+_5d,aY+_5e); | |
232 this.lineTo(aX,aY+_5e); | |
233 this.closePath(); | |
234 }; | |
235 _31.strokeRect=function(aX,aY,_61,_62){ | |
236 var _63=this.currentPath_; | |
237 this.beginPath(); | |
238 this.moveTo(aX,aY); | |
239 this.lineTo(aX+_61,aY); | |
240 this.lineTo(aX+_61,aY+_62); | |
241 this.lineTo(aX,aY+_62); | |
242 this.closePath(); | |
243 this.stroke(); | |
244 this.currentPath_=_63; | |
245 }; | |
246 _31.fillRect=function(aX,aY,_66,_67){ | |
247 var _68=this.currentPath_; | |
248 this.beginPath(); | |
249 this.moveTo(aX,aY); | |
250 this.lineTo(aX+_66,aY); | |
251 this.lineTo(aX+_66,aY+_67); | |
252 this.lineTo(aX,aY+_67); | |
253 this.closePath(); | |
254 this.fill(); | |
255 this.currentPath_=_68; | |
256 }; | |
257 _31.createLinearGradient=function(aX0,aY0,aX1,aY1){ | |
258 var _6d=new CanvasGradient_("gradient"); | |
259 _6d.x0_=aX0; | |
260 _6d.y0_=aY0; | |
261 _6d.x1_=aX1; | |
262 _6d.y1_=aY1; | |
263 return _6d; | |
264 }; | |
265 _31.createRadialGradient=function(aX0,aY0,aR0,aX1,aY1,aR1){ | |
266 var _74=new CanvasGradient_("gradientradial"); | |
267 _74.x0_=aX0; | |
268 _74.y0_=aY0; | |
269 _74.r0_=aR0; | |
270 _74.x1_=aX1; | |
271 _74.y1_=aY1; | |
272 _74.r1_=aR1; | |
273 return _74; | |
274 }; | |
275 _31.drawImage=function(_75,_76){ | |
276 var dx,dy,dw,dh,sx,sy,sw,sh; | |
277 var _7f=_75.runtimeStyle.width; | |
278 var _80=_75.runtimeStyle.height; | |
279 _75.runtimeStyle.width="auto"; | |
280 _75.runtimeStyle.height="auto"; | |
281 var w=_75.width; | |
282 var h=_75.height; | |
283 _75.runtimeStyle.width=_7f; | |
284 _75.runtimeStyle.height=_80; | |
285 if(arguments.length==3){ | |
286 dx=arguments[1]; | |
287 dy=arguments[2]; | |
288 sx=sy=0; | |
289 sw=dw=w; | |
290 sh=dh=h; | |
291 }else{ | |
292 if(arguments.length==5){ | |
293 dx=arguments[1]; | |
294 dy=arguments[2]; | |
295 dw=arguments[3]; | |
296 dh=arguments[4]; | |
297 sx=sy=0; | |
298 sw=w; | |
299 sh=h; | |
300 }else{ | |
301 if(arguments.length==9){ | |
302 sx=arguments[1]; | |
303 sy=arguments[2]; | |
304 sw=arguments[3]; | |
305 sh=arguments[4]; | |
306 dx=arguments[5]; | |
307 dy=arguments[6]; | |
308 dw=arguments[7]; | |
309 dh=arguments[8]; | |
310 }else{ | |
311 throw Error("Invalid number of arguments"); | |
312 } | |
313 } | |
314 } | |
315 var d=this.getCoords_(dx,dy); | |
316 var w2=sw/2; | |
317 var h2=sh/2; | |
318 var _86=[]; | |
319 var W=10; | |
320 var H=10; | |
321 _86.push(" <g_vml_:group"," coordsize=\"",Z*W,",",Z*H,"\""," coordorigin=\"0,0\""," style=\"width:",W,"px;height:",H,"px;position:absolute;"); | |
322 if(this.m_[0][0]!=1||this.m_[0][1]){ | |
323 var _89=[]; | |
324 _89.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",mr(d.x/Z),",","Dy=",mr(d.y/Z),""); | |
325 var max=d; | |
326 var c2=this.getCoords_(dx+dw,dy); | |
327 var c3=this.getCoords_(dx,dy+dh); | |
328 var c4=this.getCoords_(dx+dw,dy+dh); | |
329 max.x=m.max(max.x,c2.x,c3.x,c4.x); | |
330 max.y=m.max(max.y,c2.y,c3.y,c4.y); | |
331 _86.push("padding:0 ",mr(max.x/Z),"px ",mr(max.y/Z),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",_89.join(""),", sizingmethod='clip');"); | |
332 }else{ | |
333 _86.push("top:",mr(d.y/Z),"px;left:",mr(d.x/Z),"px;"); | |
334 } | |
335 _86.push(" \">","<g_vml_:image src=\"",_75.src,"\""," style=\"width:",Z*dw,"px;"," height:",Z*dh,"px;\""," cropleft=\"",sx/w,"\""," croptop=\"",sy/h,"\""," cropright=\"",(w-sx-sw)/w,"\""," cropbottom=\"",(h-sy-sh)/h,"\""," />","</g_vml_:group>"); | |
336 this.element_.insertAdjacentHTML("BeforeEnd",_86.join("")); | |
337 }; | |
338 _31.stroke=function(_8e){ | |
339 var _8f=[]; | |
340 var _90=false; | |
341 var a=processStyle(_8e?this.fillStyle:this.strokeStyle); | |
342 var _92=a.color; | |
343 var _93=a.alpha*this.globalAlpha; | |
344 var W=10; | |
345 var H=10; | |
346 _8f.push("<g_vml_:shape"," filled=\"",!!_8e,"\""," style=\"position:absolute;width:",W,"px;height:",H,"px;\""," coordorigin=\"0 0\" coordsize=\"",Z*W," ",Z*H,"\""," stroked=\"",!_8e,"\""," path=\""); | |
347 var _96=false; | |
348 var min={x:null,y:null}; | |
349 var max={x:null,y:null}; | |
350 for(var i=0;i<this.currentPath_.length;i++){ | |
351 var p=this.currentPath_[i]; | |
352 var c; | |
353 switch(p.type){ | |
354 case "moveTo": | |
355 c=p; | |
356 _8f.push(" m ",mr(p.x),",",mr(p.y)); | |
357 break; | |
358 case "lineTo": | |
359 _8f.push(" l ",mr(p.x),",",mr(p.y)); | |
360 break; | |
361 case "close": | |
362 _8f.push(" x "); | |
363 p=null; | |
364 break; | |
365 case "bezierCurveTo": | |
366 _8f.push(" c ",mr(p.cp1x),",",mr(p.cp1y),",",mr(p.cp2x),",",mr(p.cp2y),",",mr(p.x),",",mr(p.y)); | |
367 break; | |
368 case "at": | |
369 case "wa": | |
370 _8f.push(" ",p.type," ",mr(p.x-this.arcScaleX_*p.radius),",",mr(p.y-this.arcScaleY_*p.radius)," ",mr(p.x+this.arcScaleX_*p.radius),",",mr(p.y+this.arcScaleY_*p.radius)," ",mr(p.xStart),",",mr(p.yStart)," ",mr(p.xEnd),",",mr(p.yEnd)); | |
371 break; | |
372 } | |
373 if(p){ | |
374 if(min.x==null||p.x<min.x){ | |
375 min.x=p.x; | |
376 } | |
377 if(max.x==null||p.x>max.x){ | |
378 max.x=p.x; | |
379 } | |
380 if(min.y==null||p.y<min.y){ | |
381 min.y=p.y; | |
382 } | |
383 if(max.y==null||p.y>max.y){ | |
384 max.y=p.y; | |
385 } | |
386 } | |
387 } | |
388 _8f.push(" \">"); | |
389 if(!_8e){ | |
390 var _9c=this.lineScale_*this.lineWidth; | |
391 if(_9c<1){ | |
392 _93*=_9c; | |
393 } | |
394 _8f.push("<g_vml_:stroke"," opacity=\"",_93,"\""," joinstyle=\"",this.lineJoin,"\""," miterlimit=\"",this.miterLimit,"\""," endcap=\"",processLineCap(this.lineCap),"\""," weight=\"",_9c,"px\""," color=\"",_92,"\" />"); | |
395 }else{ | |
396 if(typeof this.fillStyle=="object"){ | |
397 var _9d=this.fillStyle; | |
398 var _9e=0; | |
399 var _9f={x:0,y:0}; | |
400 var _a0=0; | |
401 var _a1=1; | |
402 if(_9d.type_=="gradient"){ | |
403 var x0=_9d.x0_/this.arcScaleX_; | |
404 var y0=_9d.y0_/this.arcScaleY_; | |
405 var x1=_9d.x1_/this.arcScaleX_; | |
406 var y1=_9d.y1_/this.arcScaleY_; | |
407 var p0=this.getCoords_(x0,y0); | |
408 var p1=this.getCoords_(x1,y1); | |
409 var dx=p1.x-p0.x; | |
410 var dy=p1.y-p0.y; | |
411 _9e=Math.atan2(dx,dy)*180/Math.PI; | |
412 if(_9e<0){ | |
413 _9e+=360; | |
414 } | |
415 if(_9e<0.000001){ | |
416 _9e=0; | |
417 } | |
418 }else{ | |
419 var p0=this.getCoords_(_9d.x0_,_9d.y0_); | |
420 var _aa=max.x-min.x; | |
421 var _ab=max.y-min.y; | |
422 _9f={x:(p0.x-min.x)/_aa,y:(p0.y-min.y)/_ab}; | |
423 _aa/=this.arcScaleX_*Z; | |
424 _ab/=this.arcScaleY_*Z; | |
425 var _ac=m.max(_aa,_ab); | |
426 _a0=2*_9d.r0_/_ac; | |
427 _a1=2*_9d.r1_/_ac-_a0; | |
428 } | |
429 var _ad=_9d.colors_; | |
430 _ad.sort(function(cs1,cs2){ | |
431 return cs1.offset-cs2.offset; | |
432 }); | |
433 var _b0=_ad.length; | |
434 var _b1=_ad[0].color; | |
435 var _b2=_ad[_b0-1].color; | |
436 var _b3=_ad[0].alpha*this.globalAlpha; | |
437 var _b4=_ad[_b0-1].alpha*this.globalAlpha; | |
438 var _b5=[]; | |
439 for(var i=0;i<_b0;i++){ | |
440 var _b6=_ad[i]; | |
441 _b5.push(_b6.offset*_a1+_a0+" "+_b6.color); | |
442 } | |
443 _8f.push("<g_vml_:fill type=\"",_9d.type_,"\""," method=\"none\" focus=\"100%\""," color=\"",_b1,"\""," color2=\"",_b2,"\""," colors=\"",_b5.join(","),"\""," opacity=\"",_b4,"\""," g_o_:opacity2=\"",_b3,"\""," angle=\"",_9e,"\""," focusposition=\"",_9f.x,",",_9f.y,"\" />"); | |
444 }else{ | |
445 _8f.push("<g_vml_:fill color=\"",_92,"\" opacity=\"",_93,"\" />"); | |
446 } | |
447 } | |
448 _8f.push("</g_vml_:shape>"); | |
449 this.element_.insertAdjacentHTML("beforeEnd",_8f.join("")); | |
450 }; | |
451 _31.fill=function(){ | |
452 this.stroke(true); | |
453 }; | |
454 _31.closePath=function(){ | |
455 this.currentPath_.push({type:"close"}); | |
456 }; | |
457 _31.getCoords_=function(aX,aY){ | |
458 var m=this.m_; | |
459 return {x:Z*(aX*m[0][0]+aY*m[1][0]+m[2][0])-Z2,y:Z*(aX*m[0][1]+aY*m[1][1]+m[2][1])-Z2}; | |
460 }; | |
461 _31.save=function(){ | |
462 var o={}; | |
463 copyState(this,o); | |
464 this.aStack_.push(o); | |
465 this.mStack_.push(this.m_); | |
466 this.m_=matrixMultiply(createMatrixIdentity(),this.m_); | |
467 }; | |
468 _31.restore=function(){ | |
469 copyState(this.aStack_.pop(),this); | |
470 this.m_=this.mStack_.pop(); | |
471 }; | |
472 function matrixIsFinite(m){ | |
473 for(var j=0;j<3;j++){ | |
474 for(var k=0;k<2;k++){ | |
475 if(!isFinite(m[j][k])||isNaN(m[j][k])){ | |
476 return false; | |
477 } | |
478 } | |
479 } | |
480 return true; | |
481 }; | |
482 function setM(ctx,m,_c0){ | |
483 if(!matrixIsFinite(m)){ | |
484 return; | |
485 } | |
486 ctx.m_=m; | |
487 if(_c0){ | |
488 var det=m[0][0]*m[1][1]-m[0][1]*m[1][0]; | |
489 ctx.lineScale_=_6(_5(det)); | |
490 } | |
491 }; | |
492 _31.translate=function(aX,aY){ | |
493 var m1=[[1,0,0],[0,1,0],[aX,aY,1]]; | |
494 setM(this,matrixMultiply(m1,this.m_),false); | |
495 }; | |
496 _31.rotate=function(_c5){ | |
497 var c=mc(_c5); | |
498 var s=ms(_c5); | |
499 var m1=[[c,s,0],[-s,c,0],[0,0,1]]; | |
500 setM(this,matrixMultiply(m1,this.m_),false); | |
501 }; | |
502 _31.scale=function(aX,aY){ | |
503 this.arcScaleX_*=aX; | |
504 this.arcScaleY_*=aY; | |
505 var m1=[[aX,0,0],[0,aY,0],[0,0,1]]; | |
506 setM(this,matrixMultiply(m1,this.m_),true); | |
507 }; | |
508 _31.transform=function(m11,m12,m21,m22,dx,dy){ | |
509 var m1=[[m11,m12,0],[m21,m22,0],[dx,dy,1]]; | |
510 setM(this,matrixMultiply(m1,this.m_),true); | |
511 }; | |
512 _31.setTransform=function(m11,m12,m21,m22,dx,dy){ | |
513 var m=[[m11,m12,0],[m21,m22,0],[dx,dy,1]]; | |
514 setM(this,m,true); | |
515 }; | |
516 _31.clip=function(){ | |
517 }; | |
518 _31.arcTo=function(){ | |
519 }; | |
520 _31.createPattern=function(){ | |
521 return new CanvasPattern_; | |
522 }; | |
523 function CanvasGradient_(_da){ | |
524 this.type_=_da; | |
525 this.x0_=0; | |
526 this.y0_=0; | |
527 this.r0_=0; | |
528 this.x1_=0; | |
529 this.y1_=0; | |
530 this.r1_=0; | |
531 this.colors_=[]; | |
532 }; | |
533 CanvasGradient_.prototype.addColorStop=function(_db,_dc){ | |
534 _dc=processStyle(_dc); | |
535 this.colors_.push({offset:_db,color:_dc.color,alpha:_dc.alpha}); | |
536 }; | |
537 function CanvasPattern_(){ | |
538 }; | |
539 G_vmlCanvasManager=_e; | |
540 CanvasRenderingContext2D=CanvasRenderingContext2D_; | |
541 CanvasGradient=CanvasGradient_; | |
542 CanvasPattern=CanvasPattern_; | |
543 })(); | |
544 } |