• 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: NSView's DrawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView's DrawRect


  • Subject: Re: NSView's DrawRect
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Sun, 10 Feb 2002 16:05:32 -0500

On Sunday, February 10, 2002, at 11:42 , Sven-S. Porst wrote:

I've made a subclass of NSView that draws a grid of blocks. In particular
I am converting the coordinates I receive from -drawRect to my 'block'
coordinates to determine which blocks need redrawing.

When I am moving the contents of a particular block to a different block
I call
-setNeedsDisplayInRect for the block it originates from and the
destination. Strangely when debugging or using the 'Quartz Debug'
application it seems that I am asked to redraw the whole rect spanned by
the two rects I passed to -setNeedsDisplayInRect. This seems a bit wasteful.

Why does this happen and how can I prevent it?
I guess, I could call my drawing method directly instead of using -
setNeedsDisplayInRect but so far my impression was that this isn't
considered the 'proper' way to do it.

Any comments or pointers for a better understanding of what's going on
are appreciated.


There was a big discussion about this several months ago, and it basically boiled down to: Apple's implementation is broken, however, it would be a bad idea to try and work around it by calling tour drawing method directly, and that it would be a better idea to pester Apple until they fix it.

--
Clark S. Cox, III
email@hidden
http://www.whereismyhead.com/clark/
_______________________________________________
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.

References: 
 >NSView's DrawRect (From: "Sven-S. Porst" <email@hidden>)

  • Prev by Date: Re: Cocoa & File Attributes Confusion
  • Next by Date: Re: NSView's DrawRect
  • Previous by thread: NSView's DrawRect
  • Next by thread: Re: NSView's DrawRect
  • Index(es):
    • Date
    • Thread