On Aug 18, 2008, at 10:54 AM, Houdah - ML Pierre Bernard wrote:

Unfortunately, the sample code left me confused. Seems to me that your drawing method always does the same thing. I find no notion of tiling. Obviously there is: when I set a breakpoint on the drawing method I can clearly see the view being drawn bit by bit. I just don't understand how it works.

Actually, thats the intended model. When a tiled layer calls on its delegate's -drawLayer:inContext: (or its own -drawInContext:) method, the context has already been transformed and clipped to capture what is necessary for the tile that its drawing. This allows for a model where you don't have to be concerned with the tiling if you don't want to be.

If you do want to be concerned with the tiles, then you can use CGContextGetClipBoundingBox() to determine the tile that you are being asked to draw. If your using the level of detail as well, you can either use that same clip box (carefully) to deduce the scale, or use CGContextGetCTM() to get the current transform matrix and use that to deduce the scale (although this relies on certain assumptions about the CTM that will be applied).

Of course, I would have hoped for an example with multiple image source containing tiles.


Noted. :).
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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]

Reply via email to