bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix: NSMatrix, getRow:column:forPoint:


From: Georg Fleischmann
Subject: Fix: NSMatrix, getRow:column:forPoint:
Date: Sat, 11 Aug 2001 23:38:06 +0200

Hi,

here is a little patch for NSMatrix. It corrects the test of the point between  
cells by one pixel.
In my test case a cell at coordinates 0/0 with zero cell spacing (intercell)  
was not detected by a point at 0/0. Now it is.

Georg


2001-08-11  Georg Fleischmann

        * gui/Source/NSMatrix.m
        [NSMatrix getRow:column:forPoint:]:
        compare >= instead of > between rows and columns


diff -u gui/Source/NSMatrix.m.orig gui/Source/NSMatrix.m

--- gui/Source/NSMatrix.m.orig  Tue Jul 10 04:30:27 2001
+++ gui/Source/NSMatrix.m       Sat Aug 11 19:36:51 2001
@@ -719,9 +719,9 @@
   beyondRows = (point.y > _bounds.size.height || point.y < 0);

   /* Determine if the point is inside the cell */
-  betweenRows = !(point.y > approxRowsHeight
+  betweenRows = !(point.y >= approxRowsHeight
                && point.y <= approxRowsHeight + _cellSize.height);
-  betweenCols = !(point.x > approxColsWidth
+  betweenCols = !(point.x >= approxColsWidth
                  && point.x <= approxColsWidth + _cellSize.width);

   if (beyondRows || betweenRows || beyondCols || betweenCols || nullMatrix)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]