(function($){
$.registerLiquidCanvasPlugin({name:"rect",paint:function(_2){
_2.ctx.beginPath();
_2.ctx.rect(0,0,_2.width,_2.height);
_2.ctx.closePath();
if(this.action){
this.action.paint(_2);
}
}});
$.registerLiquidCanvasPlugin({name:"roundedRect",defaultOpts:{radius:20},paint:function(_3){
var _4=_3.ctx;
var _5=this.opts;
_4.beginPath();
_4.moveTo(0,_5.radius);
_4.lineTo(0,_3.height-_5.radius);
_4.quadraticCurveTo(0,_3.height,_5.radius,_3.height);
_4.lineTo(_3.width-_5.radius,_3.height);
_4.quadraticCurveTo(_3.width,_3.height,_3.width,_3.height-_5.radius);
_4.lineTo(_3.width,_5.radius);
_4.quadraticCurveTo(_3.width,0,_3.width-_5.radius,0);
_4.lineTo(_5.radius,0);
_4.quadraticCurveTo(0,0,0,_5.radius);
_4.closePath();
if(this.action){
this.action.paint(_3);
}
},shrink:function(_6,_7){
this.defaultShrink(_6,_7);
this.opts.radius-=_7;
}});
$.registerLiquidCanvasPlugin({name:"fill",defaultOpts:{color:"#aaa"},paint:function(_8){
_8.ctx.fillStyle=this.opts.color;
this.action.paint(_8);
_8.ctx.fill();
}});
$.registerLiquidCanvasPlugin({name:"image",defaultOpts:{url:"http://www.ruzee.com/files/liquid-canvas-image.png"},paint:function(_9){
var _a=new Image();
_a.src=this.opts.url;
_a.onload=function(){
_9.ctx.drawImage(this,0,0);
};
}});
$.registerLiquidCanvasPlugin({name:"gradient",defaultOpts:{from:"#fff",to:"#666"},paint:function(_b){
var _c=_b.ctx.createLinearGradient(0,0,0,_b.height);
_c.addColorStop(0,this.opts.from);
_c.addColorStop(1,this.opts.to);
_b.ctx.fillStyle=_c;
this.action.paint(_b);
_b.ctx.fill();
}});
$.registerLiquidCanvasPlugin({name:"shadow",defaultOpts:{width:3,color:"#000",shift:2},paint:function(_d){
var sw=this.opts.width;
_d.ctx.fillStyle=this.opts.color;
_d.ctx.globalAlpha=1/sw;
for(var s=0;s<sw;++s){
this.action.paint(_d);
_d.ctx.fill();
this.action.shrink(_d,1);
}
_d.ctx.globalAlpha=1;
_d.ctx.translate(0,-this.opts.shift);
}});
$.registerLiquidCanvasPlugin({name:"border",defaultOpts:{color:"#f80",width:3},paint:function(_10){
var bw=this.opts.width;
_10.ctx.strokeStyle=this.opts.color;
_10.ctx.lineWidth=bw;
this.action.shrink(_10,bw/2);
this.action.paint(_10);
_10.ctx.stroke();
this.action.shrink(_10,bw/2);
}});
})(jQuery);


