clean up comments pertaining to position, autoPadding, shrinking.

This commit is contained in:
Christopher Jeffrey 2015-03-31 05:14:44 -07:00
parent 4419794991
commit 903886f083

View File

@ -294,9 +294,9 @@ function Screen(options) {
left: this.left = this.aleft = this.rleft = 0, left: this.left = this.aleft = this.rleft = 0,
right: this.right = this.aright = this.rright = 0, right: this.right = this.aright = this.rright = 0,
top: this.top = this.atop = this.rtop = 0, top: this.top = this.atop = this.rtop = 0,
bottom: this.bottom = this.abottom = this.rbottom = 0 bottom: this.bottom = this.abottom = this.rbottom = 0,
//get height() { return self.height; }, get height() { return self.height; },
//get width() { return self.width; } get width() { return self.width; }
}; };
this.ileft = 0; this.ileft = 0;
@ -381,7 +381,6 @@ function Screen(options) {
} }
}); });
// XXX Not used right now since we're using our own EventEmitter:
this.setMaxListeners(Infinity); this.setMaxListeners(Infinity);
Screen.total++; Screen.total++;
@ -2958,9 +2957,7 @@ Element.prototype._getWidth = function(get) {
&& this.position.left !== 'center') { && this.position.left !== 'center') {
width -= this.parent.ileft; width -= this.parent.ileft;
} }
// if (this.position.right != null) {
width -= this.parent.iright; width -= this.parent.iright;
// }
} }
} }
@ -3002,9 +2999,7 @@ Element.prototype._getHeight = function(get) {
&& this.position.top !== 'center') { && this.position.top !== 'center') {
height -= this.parent.itop; height -= this.parent.itop;
} }
// if (this.position.bottom != null) {
height -= this.parent.ibottom; height -= this.parent.ibottom;
// }
} }
} }
@ -3054,9 +3049,7 @@ Element.prototype._getRight = function(get) {
if (this.position.right == null && this.position.left != null) { if (this.position.right == null && this.position.left != null) {
right = this.screen.cols - (this._getLeft(get) + this._getWidth(get)); right = this.screen.cols - (this._getLeft(get) + this._getWidth(get));
if (this.screen.autoPadding) { if (this.screen.autoPadding) {
// if (this.position.right != null) {
right += this.parent.iright; right += this.parent.iright;
// }
} }
return right; return right;
} }
@ -3064,9 +3057,7 @@ Element.prototype._getRight = function(get) {
right = (parent.aright || 0) + (this.position.right || 0); right = (parent.aright || 0) + (this.position.right || 0);
if (this.screen.autoPadding) { if (this.screen.autoPadding) {
// if (this.position.right != null) {
right += this.parent.iright; right += this.parent.iright;
// }
} }
return right; return right;
@ -3115,9 +3106,7 @@ Element.prototype._getBottom = function(get) {
if (this.position.bottom == null && this.position.top != null) { if (this.position.bottom == null && this.position.top != null) {
bottom = this.screen.rows - (this._getTop(get) + this._getHeight(get)); bottom = this.screen.rows - (this._getTop(get) + this._getHeight(get));
if (this.screen.autoPadding) { if (this.screen.autoPadding) {
// if (this.position.bottom != null) {
bottom += this.parent.ibottom; bottom += this.parent.ibottom;
// }
} }
return bottom; return bottom;
} }
@ -3125,9 +3114,7 @@ Element.prototype._getBottom = function(get) {
bottom = (parent.abottom || 0) + (this.position.bottom || 0); bottom = (parent.abottom || 0) + (this.position.bottom || 0);
if (this.screen.autoPadding) { if (this.screen.autoPadding) {
// if (this.position.bottom != null) {
bottom += this.parent.ibottom; bottom += this.parent.ibottom;
// }
} }
return bottom; return bottom;
@ -3396,7 +3383,6 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl, get) {
if (!this.screen.autoPadding) { if (!this.screen.autoPadding) {
xi -= this.padding.left + this.padding.right; xi -= this.padding.left + this.padding.right;
} else { } else {
//xi -= this.padding.left;
xi -= this.ileft; xi -= this.ileft;
} }
} else { } else {
@ -3435,7 +3421,6 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl, get) {
if (!this.screen.autoPadding) { if (!this.screen.autoPadding) {
yi -= this.padding.top + this.padding.bottom; yi -= this.padding.top + this.padding.bottom;
} else { } else {
//yi -= this.padding.top;
yi -= this.itop; yi -= this.itop;
} }
} else { } else {
@ -3443,7 +3428,6 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl, get) {
if (!this.screen.autoPadding) { if (!this.screen.autoPadding) {
yl += this.padding.top + this.padding.bottom; yl += this.padding.top + this.padding.bottom;
} else { } else {
//yl += this.padding.bottom;
yl += this.ibottom; yl += this.ibottom;
} }
} }
@ -3469,7 +3453,6 @@ Element.prototype._getShrinkContent = function(xi, xl, yi, yl, get) {
if (this.position.height == null if (this.position.height == null
&& (this.position.top == null && (this.position.top == null
|| this.position.bottom == null) || this.position.bottom == null)
// && !this.scrollable) {
&& (!this.scrollable || this._isList)) { && (!this.scrollable || this._isList)) {
if (this.position.top == null && this.position.bottom != null) { if (this.position.top == null && this.position.bottom != null) {
yi = yl - h - this.iheight; yi = yl - h - this.iheight;