Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
- Subject: Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
- From: j o a r <email@hidden>
- Date: Fri, 2 Apr 2004 08:53:04 +0200
On 2004-04-02, at 08.18, Drew McCormack wrote:
>
It seems like it might be a bug in the Cocoa drawing code, to do with
>
exception handling.
Possible, but unlikely...
>
Here is a cut down version of the code in the NRTPlotView class:
>
>
- (void)drawRect:(NSRect)rect
>
{
>
[_cachedImage release];
>
_cachedImage = [[NSImage alloc] initWithSize:[self
>
frame].size];
>
[_cachedImage lockFocus];
>
>
[_component drawInPlotView:self]; // This code includes the
>
NS_DURING block
>
>
[_cachedImage unlockFocus];
>
[_cachedImage compositeToPoint:rect.origin fromRect:rect
>
operation:NSCompositeSourceOver];
>
}
Two questions:
* What happens in "drawInPlotView:"?
* Why do you use "compositToPoint:..." *after* you have unlocked the
image? Are you not supposed to bracket all drawing operations inside a
lock/unlock block?
* What are you drawing in the last "compositToPoint:..." operation?
>
Is this a bug, or am I doing something illegal with when I lock focus
>
on the NSImage?
I would guess the latter.
j o a r
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.