Ensure the NSTableView rowAtPoint: method always returns a valid row number.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20584 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2005-01-20 09:44:52 +00:00
parent d297a62697
commit 90952ec827
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2005-01-20 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableView.m (-rowAtPoint:): If the heigh of the table
is incorrect and because of this the row would be greater than the
number of rows, return a usable number.
2005-01-18 17:06 Alexander Malmberg <alexander@malmberg.org>
* Source/NSWindow.m

View file

@ -3910,10 +3910,10 @@ static inline float computePeriod(NSPoint mouseLocationWin,
aPoint.y -= _bounds.origin.y;
return_value = (int) (aPoint.y / _rowHeight);
/* This could happen if point lies on the grid line below the last row */
if (return_value == _numberOfRows)
/* This could happen if point lies on the grid line or below the last row */
if (return_value >= _numberOfRows)
{
return_value--;
return_value = _numberOfRows - 1;
}
return return_value;
}