Fwd: Conceptually understanding Core Animation
Fwd: Conceptually understanding Core Animation
- Subject: Fwd: Conceptually understanding Core Animation
- From: Bill Dudney <email@hidden>
- Date: Tue, 5 Feb 2008 11:38:14 -0700
Hi All,
For posterity and so no one else has to fight with it;
This issue is triggered because the CAKeyframeAnimation object does
not have an explicit keyPath property (it defaults to the key given to
-addAnimation:forKey:, which works for rendering the animation, but
currently not for evaluating it via -presentationLayer). So a simple
workaround is to change the second line of the -positionAnimation
method to this:
positionAnimation = [CAKeyframeAnimation
animationWithKeyPath:@"position"];
The response to the bug I filed, simple workaround, I love that!
Basically I did not explicitly set the key path that the keyframe
animation was modifying so the presentation layer was none the wiser.
Would be interesting to try with other animation types... I will poke
on that and post it on my blog.
TTFN,
-bd-
http://bill.dudney.net/roller/objc
On Feb 4, 2008, at 9:51 PM, Bill Dudney wrote:
FWIW: filed under problem id #5723911 with bugreport.apple.com...
-bd-
http://bill.dudney.net/roller/objc
On Feb 4, 2008, at 3:55 PM, Bill Dudney wrote:
Hi Scott,
I'm not seeing the behavior described here (at least my
understanding of what is described here is not happening :)
I have two animations, one explicit and one implied. When the
implied animation is run (i.e. I set the layers position) the
following code does what I expect (the presentation layer's
position changes as I click).
- (void)mouseDown:(NSEvent *)event {
NSPoint point = [self convertPoint:[event locationInWindow]
fromView:nil];
CALayer *presLayer = [self.photoLayer presentationLayer];
CALayer *layer = [presLayer hitTest:*(CGPoint*)&point];
NSLog(@"pres pos.x = %f, pres pos.y = %f",
presLayer.frame.origin.x, presLayer.frame.origin.y);
...
}
When I'm running the explicit animation the presentation layer's
position does not change.
Is it just the render tree that updates when an explicit animation
is used?
If this is a bug I'd be glad to submit the sample code to reproduce.
Thanks,
-bd-
http://bill.dudney.net/roller/objc
_______________________________________________
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