From 16bbb5ea240b44ad8e55582e735d2a456d65e2fc Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 4 Aug 2013 09:06:04 -0500 Subject: [PATCH] allow zero-width elements. enforce minimums for shrink. --- lib/widget.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index c1c47bc..769b1a8 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2712,10 +2712,10 @@ Element.prototype.__defineGetter__('tpadding', function() { Element.prototype._getShrinkBox = function(xi, xl, yi, yl) { if (!this.children.length) { - return { xi: xi, xl: xi, yi: yi, yl: yi }; + return { xi: xi, xl: xi + 1, yi: yi, yl: yi + 1 }; } - var i, el, ret, mxi = 0, mxl = 0, myi = 0, myl = 0; + var i, el, ret, mxi = xi, mxl = xi + 1, myi = yi, myl = yi + 1; for (i = 0; i < this.children.length; i++) { el = this.children[i]; @@ -2775,7 +2775,7 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl) { Element.prototype._getShrinkContent = function(xi, xl, yi, yl) { var h = this._clines.length - , w = this._clines.mwidth; + , w = this._clines.mwidth || 1; if (this.position.width == null && (this.position.left == null @@ -2946,6 +2946,7 @@ Element.prototype._getCoords = function(get) { if (this.border) xl++; if (this.parent.border) xl--; } + //if (xi > xl) return; if (xi >= xl) return; }