• 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 A Mutable String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing A Mutable String


  • Subject: Re: Drawing A Mutable String
  • From: Andy Lee <email@hidden>
  • Date: Wed, 13 Jan 2010 01:42:35 -0500

On Jan 12, 2010, at 1:29 PM, Michael Craig wrote:
> Well, I feel dumb. Your (Andy's) mention of setNeedsDisplay: caught my eye, and I realized soon after that the button whose method causes invalidStack to be YES never tells the view the redraw. I still don't entirely understand why the text didn't get drawn when the view was subsequently redrawn (because of tabbing through controls, resizing, etc.), but at least it works as intended now.
>
> Any insight is still appreciated.

My guess is that the rectangle passed to drawRect: did not intersect the area where you draw the string.  Drawing is clipped to that rectangle, so even though you were executing drawing code no pixels were actually changed.  See what happens if you do

    NSLog(@"%@ intersects %@? %d", NSStringFromRect(dirtyRect), NSStringFromRect(infoRect), NSIntersectsRect(dirtyRect, infoRect));

...where dirtyRect is the argument passed to drawRect:.

--Andy


_______________________________________________

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: 
 >Re: Drawing A Mutable String (From: Andy Lee <email@hidden>)
 >Re: Drawing A Mutable String (From: Michael Craig <email@hidden>)

  • Prev by Date: Re: AppController dealloc is never called. Why?
  • Next by Date: Re: Managed Object with Getter
  • Previous by thread: Re: Drawing A Mutable String
  • Next by thread: Trouble with dragging and file promises
  • Index(es):
    • Date
    • Thread