//>>built
define("dojox/drawing/annotations/Angle",["dojo","../util/oo","../util/positioning"],function(b,f,g){return f.declare(function(c){this.stencil=c.stencil;this.util=c.stencil.util;this.mouse=c.stencil.mouse;this.stencil.connectMult([["onDrag",this,"showAngle"],["onUp",this,"hideAngle"],["onTransformBegin",this,"showAngle"],["onTransform",this,"showAngle"],["onTransformEnd",this,"hideAngle"]])},{type:"dojox.drawing.tools.custom",angle:0,showAngle:function(){if(this.stencil.selected||!this.stencil.created)if(this.stencil.getRadius()<
this.stencil.minimumSize)this.hideAngle();else{var c=this.getAngleNode(),a=this.stencil.pointsToData();a=g.angle({x:a.x1,y:a.y1},{x:a.x2,y:a.y2});var e=this.mouse.scrollOffset(),d=this.stencil.getTransform(),h=d.dx/this.mouse.zoom;d=d.dy/this.mouse.zoom;a.x/=this.mouse.zoom;a.y/=this.mouse.zoom;b.style(c,{left:this.stencil._offX+a.x-e.left+h+"px",top:this.stencil._offY+a.y-e.top+d+"px",align:a.align});a=this.stencil.getAngle();c.innerHTML=this.stencil.style.zAxis&&"vector"==this.stencil.shortType?
0<this.stencil.data.cosphi?"out of":"into":"line"==this.stencil.shortType?this.stencil.style.zAxis?"out of":Math.ceil(a%180):Math.ceil(a)}},getAngleNode:function(){this._angleNode||(this._angleNode=b.create("span",null,b.body()),b.addClass(this._angleNode,"textAnnotation"),b.style(this._angleNode,"opacity",1));return this._angleNode},hideAngle:function(){this._angleNode&&.9<b.style(this._angleNode,"opacity")&&(b.fadeOut({node:this._angleNode,duration:500,onEnd:function(c){b.destroy(c)}}).play(),this._angleNode=
null)}})});