facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

fromValue get current value and not initial value #195

Open walteryaron opened 9 years ago

walteryaron commented 9 years ago

When using [POPBasicAnimation animationWithPropertyNamed:kPOPLayerScaleXY]; animation.fromValue = [NSValue valueWithCGSize:CGSizeMake(0.f, 0.f)]; animation.toValue = [NSValue valueWithCGSize:CGSizeMake(1.f, 1.f)]; when using multiple time the animation, the frame get bigger and bigger https://www.dropbox.com/s/70540el22om3ys4/Untitled%203.m4v?dl=0

kimon commented 9 years ago

From the description, it sounds like a bug, though I don't believe we have any other reports of this. Could this already be fixed? If you're still seeing this, please attach sample code and we can help debug.

pronebird commented 9 years ago

I can't reproduce this. Tested on CAShapeLayer with both Spring and Basic animations.

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

kos9kus commented 7 years ago

I could reproduce a similar bug with POPSpringAnimation object when I specified a from value. My animated view had got flashed before animation got started.

POPSpringAnimation *positionAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionY];
// the problem line:
    positionAnimation.fromValue = @(2 * animatedView.layer.position.y + CGRectGetHeight(animatedView.bounds) / 2);
//
    positionAnimation.toValue = @(containerView.center.y);
    positionAnimation.springBounciness = 5;
    positionAnimation.springSpeed = 20.f;

I'm attaching video where it's displayed: https://cloud.mail.ru/public/CQzN/inBSiAx59 We can watch the presented view is bouncing up and down unexpectedly

Was it fixed somewhere ?!