From 83dc0a3b130d92269edb3ae7f80b95ad6a8d3c78 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rivaille Date: Mon, 20 Aug 2001 10:48:09 +0000 Subject: [PATCH] [NSMatrix -sizeToFit] : This method now assumes that all cells have the same size (this is what specification says). If it is not the case, weird behaviour can happen ... git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10739 72102866-910b-0410-8b05-ffd578937521 --- Source/NSMatrix.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 878c054e2..a85b55e83 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -1627,6 +1627,11 @@ static SEL getSel; - (void) sizeToFit { NSSize newSize = NSZeroSize; + + /* + * FIXME : Maybe this code be enabled in debug mode ? + * it would detect if all the cells have the same size + * or not NSSize tmpSize; int i, j; @@ -1641,6 +1646,12 @@ static SEL getSel; newSize.height = tmpSize.height; } } + */ + + + if (_numRows > 0 && _numCols > 0) + newSize = [_cells[0][0] cellSize]; + [self setCellSize: newSize]; }