text: /**
   * Hilo 1.0.1 for amd
   * Copyright 2016 alibaba.com
   * Licensed under the MIT License
   */
  define("hilo/view/View",["hilo/core/Hilo","hilo/core/Class","hilo/event/EventMixin","hilo/geom/Matrix"],function(t,e,i,n){var r=function(){function r(t,e,i){for(var n,r,o,a,h=0,s=!1,u=0,y=i.length;y>u;u++){var l=i[u],x=i[(u+1)%y];if(l.y==x.y&&e==l.y&&(l.x>x.x?(n=x.x,r=l.x):(n=l.x,r=x.x),t>=n&&r>=t))s=!0;else if(l.y>x.y?(o=x.y,a=l.y):(o=l.y,a=x.y),!(o>e||e>a)){var d=(e-l.y)*(x.x-l.x)/(x.y-l.y)+l.x;if(d>t?h++:d==t&&(s=!0),l.x>t&&l.y==e){var c=i[(y+u-1)%y];(c.y<e&&x.y>e||c.y>e&&x.y<e)&&h++}}}return s||h%2==1}function o(t,e){var i=a(t,e,{overlap:-(1/0),normal:{x:0,y:0}});return i?a(e,t,i):!1}function a(t,e,i){for(var n,r,o,a,h,s,u,y,l,x=t.length,d=e.length,c={x:0,y:0},f=0;x>f;f++){n=t[f],r=t[x-1>f?f+1:0],c.x=n.y-r.y,c.y=r.x-n.x,o=Math.sqrt(c.x*c.x+c.y*c.y),c.x/=o,c.y/=o,a=h=t[0].x*c.x+t[0].y*c.y;for(var v=1;x>v;v++)y=t[v].x*c.x+t[v].y*c.y,y>h?h=y:a>y&&(a=y);for(s=u=e[0].x*c.x+e[0].y*c.y,v=1;d>v;v++)y=e[v].x*c.x+e[v].y*c.y,y>u?u=y:s>y&&(s=y);if(s>a?(l=s-h,c.x=-c.x,c.y=-c.y):l=a-u,l>=0)return!1;l>i.overlap&&(i.overlap=l,i.normal.x=c.x,i.normal.y=c.y)}return i}return e.create({Mixes:i,constructor:function(e){e=e||{},this.id=this.id||e.id||t.getUid("View"),t.copy(this,e,!0)},id:null,x:0,y:0,width:0,height:0,alpha:1,rotation:0,visible:!0,pivotX:0,pivotY:0,scaleX:1,scaleY:1,pointerEnabled:!0,background:null,mask:null,align:null,drawable:null,boundsArea:null,parent:null,depth:-1,getStage:function(){for(var t,e=this;t=e.parent;)e=t;return e.canvas?e:null},getScaledWidth:function(){return this.width*this.scaleX},getScaledHeight:function(){return this.height*this.scaleY},addTo:function(t,e){return"number"==typeof e?t.addChildAt(this,e):t.addChild(this),this},removeFromParent:function(){var t=this.parent;return t&&t.removeChild(this),this},getBounds:function(){for(var t,e,i,n,r,o,a,h=this.width,s=this.height,u=this.getConcatenatedMatrix(),y=this.boundsArea||[{x:0,y:0},{x:h,y:0},{x:h,y:s},{x:0,y:s}],l=[],x=0,d=y.length;d>x;x++)t=u.transformPoint(y[x],!0,!0),e=t.x,i=t.y,0==x?(n=r=e,o=a=i):(n>e?n=e:e>r&&(r=e),o>i?o=i:i>a&&(a=i)),l[x]=t;return l.x=n,l.y=o,l.width=r-n,l.height=a-o,l},getConcatenatedMatrix:function(t){for(var e=new n(1,0,0,1,0,0),i=this;i!=t&&i.parent;i=i.parent){var r=1,o=0,a=i.rotation%360,h=i.pivotX,s=i.pivotY,u=i.scaleX,y=i.scaleY;if(a){var l=a*Math.PI/180;r=Math.cos(l),o=Math.sin(l)}0!=h&&(e.tx-=h),0!=s&&(e.ty-=s),e.concat(r*u,o*u,-o*y,r*y,i.x,i.y)}return e},hitTestPoint:function(t,e,i){var n=this.getBounds(),o=t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height;return o&&i&&(o=r(t,e,n)),o},hitTestObject:function(t,e){var i=this.getBounds(),n=t.getBounds(),r=i.x<=n.x+n.width&&n.x<=i.x+i.width&&i.y<=n.y+n.height&&n.y<=i.y+i.height;return r&&e&&(r=o(i,n)),!!r},_render:function(t,e){this.onUpdate&&this.onUpdate(e)===!1||!t.startDraw(this)||(t.transform(this),this.render(t,e),t.endDraw(this))},_fireMouseEvent:function(e){if(e.eventCurrentTarget=this,this.fire(e),"mousemove"==e.type){if(!this.__mouseOver){this.__mouseOver=!0;var i=t.copy({},e);i.type="mouseover",this.fire(i)}}else"mouseout"==e.type&&(this.__mouseOver=!1);var n=this.parent;e._stopped||e._stopPropagationed||!n||("mouseout"==e.type||"touchout"==e.type?n.hitTestPoint(e.stageX,e.stageY,!0)||n._fireMouseEvent(e):n._fireMouseEvent(e))},onUpdate:null,render:function(t,e){t.draw(this)},toString:function(){return t.viewToString(this)}})}();return r});