Fix negative height request in WellGrid

When WellGrid had no child it was doing a division by zero,
which screwed up the calculation for the height request and
having it ask for a negative number. This commit fixes this
by always requesting 0 in this case.
This commit is contained in:
Siegfried-Angel Gevatter Pujals 2009-08-09 03:34:35 +02:00
parent 5a75b44f71
commit 4495f98dce

View File

@ -686,6 +686,8 @@ WellGrid.prototype = {
let columnsNatural;
let i;
let children = this._getItemChildren();
if (children.length == 0)
return [0, WELL_DEFAULT_COLUMNS, 0, 0];
let nColumns;
if (children.length < WELL_DEFAULT_COLUMNS)
nColumns = children.length;