• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
      • From: Drew McCormack <email@hidden>
References: 
 >Bug in Cocoa drawing? (was 'Changing subviews during drawing') (From: Drew McCormack <email@hidden>)

  • Prev by Date: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
  • Next by Date: Re: Is the internet avaliable question
  • Previous by thread: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
  • Next by thread: Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
  • Index(es):
    • Date
    • Thread