Re: NSBezierPath problems, seems to be two bugs
Re: NSBezierPath problems, seems to be two bugs
- Subject: Re: NSBezierPath problems, seems to be two bugs
- From: Jochen Moeller <email@hidden>
- Date: Thu, 16 Oct 2008 01:55:00 +0200
Hi Aki,
thanks a lot for the valuable info which was new to me.
With setting NSCompositeCopy of the current context I could exactly
reproduce the feature of NSRectFill() with -fillRect:.
This means that also the light grey shape still remains during the
animation which was the reason for me to try -fillRect: ;-)
So one issue is solved, maybe the other will follow?
Thanks again,
Jochen Moeller
On 15.10.2008, at 19:21, Aki Inoue wrote:
Jochen,
The behavioral differences you're observing is the result of
NSCompositingOperation setting.
NSRectFill() uses NSCompositeCopy whereas NSBezierPath does not
modify the current setting that is accessible via -
[NSGraphicsContext compositingOperation].
Aki
On 2008/10/15, at 4:56, Jochen Moeller wrote:
Hello List,
in the sample code Movie_Overlay (here with Xcode 3.1.1)
<http://developer.apple.com/samplecode/Movie_Overlay/index.html>
both subviews (AnimationView and ImageView) are filled with -
whiteColor in -drawRect:.
- (void)drawRect:(NSRect)rect { // original AnimationView.m
[[NSColor whiteColor] set];
NSRectFill(rect);
[self doStarAnimation];
}
This is not what I want because the movie is dimmed with increasing
alpha values in the overlay. So I replaced the -whiteColor by -
clearColor in both -drawRect: and used bounds instead of rect.
Additionally I set the alpha value to 0.5 (instead 0.3) in
MyDocument.
- (void)drawRect:(NSRect)rect { // 1st modification
[[NSColor clearColor] set]; // in AnimationView.m
NSRectFill([self bounds]);
[self doStarAnimation];
}
1st Issue:
This worked fine in ImageView but in AnimationView remained a light
grey shape of the animation figure which was not erased by
NSRectFill().
...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden