From 4495f98dcec83c2726cedf9aba5afd3c1d97ddea Mon Sep 17 00:00:00 2001 From: Siegfried-Angel Gevatter Pujals Date: Sun, 9 Aug 2009 03:34:35 +0200 Subject: [PATCH] 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. --- js/ui/appDisplay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index f9924046f..1558f71f7 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -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;