discuss-gnustep
[Top][All Lists]
Advanced

[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: Mon, 19 Feb 2007 17:42:44 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20060911)

Hi Andreas,

you did just reply to me privately, but as you wrote in English, I
expect that you wanted to send this mail to the list.

I made a mistake in my mail. I wanted to make the subclass of the matrix
non-flipped, but wrote flipped. NSMatrix itself is always flipped and
the subclass should have been the other way around.

I started your example code, the GSDock application, and it really does
not display anything within the dock, when the isFlipped method returns
NO. Looks like you have found a bug in GNUstep. I will change NSMatrix
to not use the flipped information in the row computation, as that seems
to be wrong.
Thank you for the bug report and all the additional information.

Cheers,
Fred

PS: If the maintainer of GSDock is reading this: I don't see any reason
for the second GNUstep specific code fragment, the pasteboard handling.
Inside of GNUstep your Apple code gets used all the time and seems to work.

Andreas Höschler schrieb:
> Hello Fred,
> 
>> 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?
> 
> Compatibility with MacOSX? I downloaded GSDock and checked the code. It
> had this in Dock.m (subclass of NSMatrix).
> 
> - (BOOL) isFlipped
> {
>    #ifdef GNUSTEP
>     return YES;
>     #endif
>     return NO;
> }
> 
> This had to be wrong and a very ugly workaround. It seems that a Matrix
> is flipped by default. In GSDock now it made and still makes sense, that
> the matrix is not flipped. The code worked fine and did the right thing
> on MacOSX with
> 
> - (BOOL) isFlipped
> {
>     return NO;
> }
> 
> but it failed completely under GNUstep. I thaught this through and came
> to the conclusion that MacOSX does the right thing. If a matrix is not
> flipped than the cell with tag 0 (row=0) should be drawn at the bottom
> and the cell with the highest index at the top. That's what my bug fix
> does. It produces compatibility with MacOSX here and it makes sense IMHO.
> 
>> I expect that you have written a subclass of NSMatrix and this subclass
>> is non-flipped and now things go wrong.
> 
> Only on GNUstep without my fix.
> 
>> 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)
> 
> Agreed!
> 
>> 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
> 
> Yes (MacOSX)!
> 
>> Or like this?
>>
>>       row 1 (10, 50)
>>       row 2
>>       row 3
>>       row 4
>> (0,0) row 5
> 
> No, this is not really flipped!
> 
>> 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.
> 
> I can only tell you that my fix makes GSDock (well, with a few fixes
>> from me)  work correctly on MacOSX and GNUstep. Here is the code of 
> GSDock (my modified version).
> 
> 
> 
> Regards,
> 
>   Andreas
> 
> 





reply via email to

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