On Sun, Feb 1, 2009 at 4:05 PM, Seth Willits <[email protected]> wrote: > 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. ;-)
You left out the word "efficiently" from the formulation of your contrapositive, which I think is important. To me, the words "optimized" and "efficiently" make it clear that it's only describing a speed enhancement, and telling you that there's no need to do your own bounding-rect culling beforehand. The full behavior of the method is described at the top of the documentation. Of course documentation quality and clarity is a matter of opinion, and may vary. Mike _______________________________________________ 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]
