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 (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 arch...@mail-archive.com

Reply via email to