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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]