//>>built
define("dojox/drawing/tools/Pencil",["dojo/_base/lang","../util/oo","../manager/_registry","../stencil/Path"],function(d,b,e,f){b=b.declare(f,function(){this._started=!1},{draws:!0,minDist:15,onDown:function(a){this._started=!0;a={x:a.x,y:a.y};this.points=[a];this.lastPoint=a;this.revertRenderHit=this.renderHit;this.closePath=this.renderHit=!1},onDrag:function(a){if(this._started&&!(this.minDist>this.util.distance(a.x,a.y,this.lastPoint.x,this.lastPoint.y))){var c={x:a.x,y:a.y};this.points.push(c);
this.render();this.checkClosePoint(this.points[0],a);this.lastPoint=c}},onUp:function(a){if(this._started)if(!this.points||2>this.points.length)this._started=!1,this.points=[];else{var c=this.getBounds();c.w<this.minimumSize&&c.h<this.minimumSize?(this.remove(this.hit,this.shape,this.closeGuide),this._started=!1,this.setPoints([])):(this.checkClosePoint(this.points[0],a,!0)&&(this.closePath=!0),this.renderHit=this.revertRenderHit,this.renderedOnce=!0,this.render(),this.onRender(this))}}});d.setObject("dojox.drawing.tools.Pencil",
b);b.setup={name:"dojox.drawing.tools.Pencil",tooltip:"Pencil Tool",iconClass:"iconLine"};e.register(b.setup,"tool");return b});