Hi Quentin,

tahnk you for taking up this issue!

Quentin Mathé wrote:
> Le 14 janv. 08 à 16:53, Fred Kiefer a écrit :
> 
>> Two comments though. In the first two changes you are doing the flipping
>> yourself. Wouldn't it be easier to call the method
>> fillHorizontalRect:withImage:flipped: with the last parameter set to
>> YES? It would be even better if Camaelong moved that isFlipped parameter
>> one method up, but this is a larger change.
> 
> What do you mean by one method up? Which method should get the isFlipped
> parameter?
> 
This is more or less just rephrasing what I wrote in my September mail.
Camaelon has one layer where it doesn't know about flipped status and
uses it again one layer below. It would be easier to know about flipping
all the way through, but most likely you already fixed this.

>> The other thing is that I don't know why the clipping failed for you and
>> would like to get more information on that. The Camaelon code there
>> again wasn't optimal. If you want to clip to a rectangle,just use
>> [NSBezierPath clipRect:].
> 
> Finally the problem proved to be somewhere else and unrelated to the
> clipping as I explain it in my previous reply to Andreas.
> This Camaelon code sems to be taken from the equivalent method in
> GSTheme -fillHorizontalRect:ithImage:fromRect:flipped:.
> After checking Apple doc (Cocoa Drawing Guide), they suggest the
> following code on p. 35:
> 
> [NSGraphicsContext saveGraphicsState];
> 
> NSBezierPath *clipPath = [NSBezierPath bezierPath];
> [clipPath appendBezierPathWithRect: rect];
> 
> [clipPath addClip];
> 
> [NSGraphicsContext restoreGraphicsState];
> 
> So I would say Camaelon code is correct, even if it's probably better to
> use NSRectClip or +[NSBezierPath clipRect:] for such clipping. What do
> you think?
> 

Correct yes, but using the shortest way to express what should happen is
in this case also the fastest one.

> Shouldn't we also use NSGraphicsContext methods rather than DPSgsave and
> DPSgrestore?
> By reading NSGraphicsContext.m in GNUstep, I found that
> -saveGraphicsState and -restoreGraphicsState are managing a state stack
> in addition to call DPS functions. I don't understand why, aren't
> DPSgsave and DPSgrestore maintaining a state stack too?
> 

The stack of the gstates is in both cases used just the same. What is
different is that the code in NSGraphicsContext.m uses a stack for
graphics contexts on top of that. This is needed as soon as multiple
contexts get used.

> A last question, why +[NSBezierPath clipRect:] doesn't call NSRectClip
> in GNUstep NSBezierPath.m? Apple documentation sounds to define them as
> identical, but I'm not perfectly sure though.
> 
clipRect calls PSrectclip and NSRectClip calls DPSrectclip which are the
identical function apart from some Macro processing. The only difference
is that the later also sets a new path, but this already gets done on
the GSGState level.

>> I hope somebody picks up your changes and gets Camaelon fully compatible
>> with current GUI.
> 
> Thanks for your september mail that was really helpful to figure out the
> proper fixes.
> 

You are welcome, I am just glade it was of use after all.

Cheers,
Fred

_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à