discuss-gnustep
[Top][All Lists]
Advanced

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

NSTableView bugs & questions


From: Pierre-Yves Rivaille
Subject: NSTableView bugs & questions
Date: Mon, 29 Jan 2001 16:05:16 +0100 (MET)

hi,

I have corrected NSTableView so that it behaves the way it behaves in
OPENSTEP 4.2 : clicking an already selected cell does not unselect it, but
rather leave it selected and unselect all other cells.

The patch also fixes a bug in columnAtPoint. 
[columnAtPoint: NSMakePoint(0, ?)] would give -1 whereas it should be 0
The only way the bug is critical is when you double-click on the left
edge (you have to be exactly on the edge's line...) of the first column
(uncaught exception NSRangeException).


I have also located a possible problem in drawRect :

[self drawRect: [self rectOfRow: _row]] causes the redrawing of _row and
of the row after _row, which is incorrect.

The problem is in NSTableView.m, (void) drawRect: (NSRect)arect
L2397 :
  endingRow = [self rowAtPoint: NSMakePoint (0, NSMaxY (aRect))];
A correction would be to replace it by
  endingRow = [self rowAtPoint: NSMakePoint (0, NSMaxY (aRect) - 1)];
but this assumes integer coordinates.
With float coordinates a solution would be
  endingRow = [self rowAtPoint: NSMakePoint (0, NSMaxY (aRect) - 1e-7)];
but the use of the 1e-7 value make this code platform dependant , hard
to maintain and subject to bugs.

Does anybody have an idea on how to fix this problem easily ? 

If not I think we should leave this small bug in code because the
drawbacks of the correction I proposed overwhelm the benefits.

oups, I forgot : can someone submit the patch ?

bye,


Pierre-Yves Rivaille

Attachment: NSTableView.m.20010129.patch
Description: Text document


reply via email to

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