[Top][All Lists]

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

Re: NSMatrix Bug Fix III

From: Fred Kiefer
Subject: Re: NSMatrix Bug Fix III
Date: Sun, 18 Feb 2007 22:59:59 +0100
User-agent: Thunderbird (X11/20060911)

Andreas Höschler schrieb:
> a third one:
> - (BOOL)getRow:(int*)row column:(int*)column forPoint:(NSPoint)aPoint
> {
> ...
>       if (_rFlags.flipped_view == NO)
>         {
> //         approxRow = _numRows - approxRow - 1;
>         }
> ...
> }

Hi Andreas,

all your changes are about the same issue. They seem to suggest that
even for a non flipped matrix the row number directly matches the point
and no swapping is needed. I am not sure, if this is really true. Do you
have any facts that prove this?
I expect that you have written a subclass of NSMatrix and this subclass
is non-flipped and now things go wrong. This may be due to a problem in
NSMatrix or in your own code. We need to find out about this first.

Although you may know all this, I will try to explain how in GNUstep
NSMatrix is supposed to work.

Lets say we have a matrix with bounds ((0, 0), (10, 50)). This matrix
has five rows and just one column. As all matrices are flipped it will
look like this

(0,0) row 1
      row 2
      row 3
      row 4
      row 5 (10, 50)

Now lets assume we have a flipped subclass with a similar layout. How
would it look like?

Like this?
      row 5 (10, 50)
      row 4
      row 3
      row 2
(0,0) row 1

Or like this?

      row 1 (10, 50)
      row 2
      row 3
      row 4
(0,0) row 5

For me it looks like the code in GNustep assumes that the later is the
case, but your code suggests the former. Now when looking for the row
that the point (5, 20) is in GNUstep would say row 4 whereas you expect
row 2. I don't know which interpretation is correct, but I don't see how
the GNUstep one might lead to the problem you are seeing. This suggest
that something else must be going on as well. And here only you have the
means to look into it.


reply via email to

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