Re: Drawing A Mutable String
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