From 8460e1c8a0ce9b54d6f1d53a7179f4201e793096 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 13 Aug 2013 11:55:47 -0500 Subject: [PATCH] possibly fix max autoPadding height+border problem An element with a border has a child with no height or width properties, but a left and top of 0: this causes the child elements background to cover the bottom and right borders. It doesn't have a `position.right`, but `iright` still needs to be subtracted. --- lib/widget.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index 49130ec..8a3657f 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2417,9 +2417,9 @@ Element.prototype._getWidth = function(get) { && this.position.left !== 'center') { width -= this.parent.ileft; } - if (this.position.right != null) { + //if (this.position.right != null) { width -= this.parent.iright; - } + //} } } @@ -2461,9 +2461,9 @@ Element.prototype._getHeight = function(get) { && this.position.top !== 'center') { height -= this.parent.itop; } - if (this.position.bottom != null) { + //if (this.position.bottom != null) { height -= this.parent.ibottom; - } + //} } } @@ -2513,9 +2513,9 @@ Element.prototype._getRight = function(get) { if (this.position.right == null && this.position.left != null) { right = this.screen.cols - (this._getLeft(get) + this._getWidth(get)); if (this.screen.autoPadding) { - if (this.position.right != null) { + //if (this.position.right != null) { right += this.parent.iright; - } + //} } return right; } @@ -2523,9 +2523,9 @@ Element.prototype._getRight = function(get) { right = (parent.right || 0) + (this.position.right || 0); if (this.screen.autoPadding) { - if (this.position.right != null) { + //if (this.position.right != null) { right += this.parent.iright; - } + //} } return right; @@ -2574,9 +2574,9 @@ Element.prototype._getBottom = function(get) { if (this.position.bottom == null && this.position.top != null) { bottom = this.screen.rows - (this._getTop(get) + this._getHeight(get)); if (this.screen.autoPadding) { - if (this.position.bottom != null) { + //if (this.position.bottom != null) { bottom += this.parent.ibottom; - } + //} } return bottom; } @@ -2584,9 +2584,9 @@ Element.prototype._getBottom = function(get) { bottom = (parent.bottom || 0) + (this.position.bottom || 0); if (this.screen.autoPadding) { - if (this.position.bottom != null) { + //if (this.position.bottom != null) { bottom += this.parent.ibottom; - } + //} } return bottom;