CALayer with No Animation
CALayer with No Animation
- Subject: CALayer with No Animation
- From: Richard Somers <email@hidden>
- Date: Mon, 18 Jan 2010 08:04:21 -0700
I am trying to draw in a CALayer subclass with all animation off. The
layer in question is a sublayer of a CAOpenGLLayer which is used in a
layer-hosted view.
When the view is resized, the CALayer bounds are updated and the layer
is redrawn.
- (void)updateBounds
{
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
CGRect rect = [[self superlayer] bounds];
[self setFrame:rect];
[CATransaction commit];
}
- (void)drawInContext:(CGContextRef)context
{
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
// Do some CG drawing ...
[CATransaction commit];
}
The problem is there is a remnant of an animation in the CALayer
instance when the view is resized. It is not a full animation, but
appears to be just one or two frames of an animation that occurs when
the view is resized. Does anyone know what is happening and how it can
be corrected?
--Richard
_______________________________________________
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