• 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: Drawing issues in custom view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing issues in custom view


  • Subject: Re: Drawing issues in custom view
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 10 Jul 2008 18:26:14 -0400

On Thu, Jul 10, 2008 at 12:30 PM, Jason Wiggins
<email@hidden> wrote:
> Not to worry, just realised what is happening. drawRect: gets called for ALL
> drawing operations in the view, not just background as I expected.
> Carry on...

This is not really true. What's happening is that your subviews are
updating and they are not fully opaque. So they need your view to draw
first before they can draw, so that they appear to be on top of your
contents as you desire.

The problem you're having is that the 'rect' parameter of the
-drawRect: method is not, in fact, the extent of your view. Rather
it's the 'dirty' rect, the area that needs updating. You should only
use this parameter to determine *what* to draw, never to determine
where. Use [self bounds] to find out the extent of your view.

For more information, see this page:

http://www.cocoadev.com/index.pl?DrawRect

Mike
_______________________________________________

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

References: 
 >Drawing issues in custom view (From: Jason Wiggins <email@hidden>)
 >Re: Drawing issues in custom view (From: Jason Wiggins <email@hidden>)

  • Prev by Date: Re: Drawing issues in custom view
  • Next by Date: Re: Intercepting Apple Events
  • Previous by thread: Re: Drawing issues in custom view
  • Next by thread: Printing a Webview
  • Index(es):
    • Date
    • Thread