Re: NSBezierPath problems, seems to be two bugs [solved]
Re: NSBezierPath problems, seems to be two bugs [solved]
- Subject: Re: NSBezierPath problems, seems to be two bugs [solved]
- From: Jochen Moeller <email@hidden>
- Date: Thu, 30 Oct 2008 14:07:40 +0100
Hello List
two weeks ago I described a remaining shape in the sample code
Movie_Overlay, when the NSColor -whiteColor was replaced by -clearColor.
Now I have implemented an overlay window in my own app and found the
cause for that shape.
It is in MyDocument.m the code line:
[overlayWindow setHasShadow:YES];
When changed to:
[overlayWindow setHasShadow:NO];
the background remains clear as expected.
So the "shape" turns out to be the shadow of the first NSBezierPath
stroke (Why only the first one in the animation?).
Another remaining question is: Why can NSRectFill() not erase that
shadow?
But the main problem is solved when no shadow is created in the
overlay window.
Greetings,
Jochen Moeller
Am 15.10.2008 um 13:56 schrieb Jochen Moeller:
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(). Therefore I replaced NSRectFill() by -fillRect: in the
next step.
- (void)drawRect:(NSRect)rect { // 2nd modification
[[NSColor clearColor] set]; // in AnimationView.m
[NSBezierPath fillRect:[self bounds]];
[self doStarAnimation];
}
_______________________________________________
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