| 1 |
- define(function(t,i,h){"use strict";function e(t){this.cfg=s.mix({width:0,height:0},t),this.init()}var s=t("./util");return s.mix(e.prototype,{init:function(){var t=this;t._xtop=0,t._xright=0,t._xleft=0,t._xbottom=0,t.refresh({width:t.cfg.width,height:t.cfg.height})},reset:function(){return this.resetTop(),this.resetLeft(),this.resetBottom(),this.resetRight(),this},resetTop:function(){return this._xtop=0,this.refresh(),this},resetLeft:function(){return this._xleft=0,this.refresh(),this},resetBottom:function(){return this._xbottom=0,this.refresh(),this},resetRight:function(){return this._xright=0,this.refresh(),this},expandTop:function(t){return this._xtop=t,this.refresh(),this},expandLeft:function(t){return this._xleft=t,this.refresh(),this},expandRight:function(t){return this._xright=t,this.refresh(),this},expandBottom:function(t){return this._xbottom=t,this.refresh(),this},refresh:function(t){return s.mix(this.cfg,t),this.top=this._xtop,this.left=this._xleft,this.bottom=(t&&t.height||this.cfg.height||0)-this._xbottom,this.right=(t&&t.width||this.cfg.width||0)-this._xright,this.width=this.right-this.left>0?this.right-this.left:0,this.height=this.bottom-this.top>0?this.bottom-this.top:0,this}}),"object"==typeof h&&h.exports?void(h.exports=e):e});
|