allow zero-width elements. enforce minimums for shrink.

This commit is contained in:
Christopher Jeffrey 2013-08-04 09:06:04 -05:00
parent 6cb640c0e5
commit 16bbb5ea24

View File

@ -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;
} }