Re: Drawing Invalidation Question
Re: Drawing Invalidation Question
- Subject: Re: Drawing Invalidation Question
- From: Seth Willits <email@hidden>
- Date: Sun, 1 Feb 2009 13:05:41 -0800
On Feb 1, 2009, at 3:07 AM, Graham Cox wrote:
As others have mentioned, there is potentially a huge difference. If
you invalidate a lot of small rectangles, the update region might be
quite complex in shape; the <rect> passed in -drawRect: is only the
bounds of this complex area.
Which is why the docs confused me. I knew there were subrectangles,
but the weird thing was this line in the docs:
"It is optimized to efficiently reject any rectangle that lies outside
the bounding box of the area the receiver is being asked to draw in
drawRect:."
So it's not optimized to reject anything outside of the sub-
rectangles? This sentence really threw me off. In retrospect and I can
see that it simply means that it's doing a simple check up front like
below, but it's a rather poorly worded description as it doesn't
mention the sub-rectangles at all. Documentation fail. ;-)
- (BOOL)needsDisplayInRect:(NSRect)rect;
{
if (!NSIntersectsRect(rect, theBigBoundingRect)) {
return NO;
}
... other checks
}
But there is also a difference in intent between....
This is probably more than you need or care to know at this point
but I thought it might be worth mentioning ;-)
Actually, it is very relevant to what I am doing. :-)
Thanks all,
--
Seth Willits
_______________________________________________
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