Re: Redrawing CALayer subclass when super layer is scaled
Re: Redrawing CALayer subclass when super layer is scaled
- Subject: Re: Redrawing CALayer subclass when super layer is scaled
- From: David Duncan <email@hidden>
- Date: Wed, 9 Jul 2008 09:56:36 -0700
On Jul 8, 2008, at 10:53 PM, Rick Mann wrote:
I'm trying to use scaling of the superlayer to implement a zoom
feature in my CAD app. The various elements in the canvas are drawn
by a CALayer subclass I have, which overrides drawInContext:. After
the zoom finishes animating, I want CA to call all the sublayer's
drawInContext: methods as necessary to re-render the layer's
contents. Is there any way to do this, short of keeping track of all
the layers myself and calling setNeedsDisplay on them?
Your best solution for rendering multi-representational content in
Core Animation is to use a CATiledLayer. It will automatically be
called to update content as you zoom in and out (assuming you specify
that the level of content exists). The drawing model is exactly the
same as with a CALayer, although you can optimize the drawing a bit
with a bit more knowledge.
--
David Duncan
Apple DTS Animation and Printing
email@hidden
_______________________________________________
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