mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-11 03:25:45 +00:00
allow zero-width elements. enforce minimums for shrink.
This commit is contained in:
parent
6cb640c0e5
commit
16bbb5ea24
@ -2712,10 +2712,10 @@ Element.prototype.__defineGetter__('tpadding', function() {
|
|||||||
|
|
||||||
Element.prototype._getShrinkBox = function(xi, xl, yi, yl) {
|
Element.prototype._getShrinkBox = function(xi, xl, yi, yl) {
|
||||||
if (!this.children.length) {
|
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++) {
|
for (i = 0; i < this.children.length; i++) {
|
||||||
el = this.children[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) {
|
Element.prototype._getShrinkContent = function(xi, xl, yi, yl) {
|
||||||
var h = this._clines.length
|
var h = this._clines.length
|
||||||
, w = this._clines.mwidth;
|
, w = this._clines.mwidth || 1;
|
||||||
|
|
||||||
if (this.position.width == null
|
if (this.position.width == null
|
||||||
&& (this.position.left == null
|
&& (this.position.left == null
|
||||||
@ -2946,6 +2946,7 @@ Element.prototype._getCoords = function(get) {
|
|||||||
if (this.border) xl++;
|
if (this.border) xl++;
|
||||||
if (this.parent.border) xl--;
|
if (this.parent.border) xl--;
|
||||||
}
|
}
|
||||||
|
//if (xi > xl) return;
|
||||||
if (xi >= xl) return;
|
if (xi >= xl) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user