Hi Fred,

Le 14 janv. 08 à 16:53, Fred Kiefer a écrit :

> Great that you started to patch this!
>
> 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?

> 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?

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?

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.

> 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.

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

Répondre à