facebookarchive / pop

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

kPOPLayerScaleXY - Bug. why the code was sometimes rotated 180° automatically? #273

Closed yexiahua closed 9 years ago

yexiahua commented 9 years ago

my code

show: POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY]; springAnimation.fromValue = [NSValue valueWithCGSize:CGSizeMake(0.1f, 0.1f)]; springAnimation.toValue = [NSValue valueWithCGSize:CGSizeMake(1.0f, 1.0f)]; springAnimation.springSpeed = 10.0; springAnimation.springBounciness = 10.0f; [_optionBgSC.layer pop_addAnimation:springAnimation forKey:@"scaleAnimation"];

hide: POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY]; springAnimation.fromValue = [NSValue valueWithCGSize:CGSizeMake(1.0f, 1.0f)]; springAnimation.toValue = [NSValue valueWithCGSize:CGSizeMake(0.0f, 0.0f)]; springAnimation.springSpeed = 10.0; springAnimation.springBounciness = 10.0f; [_optionBgSC.layer pop_addAnimation:springAnimation forKey:@"scaleAnimation"];

darknoon commented 9 years ago

Could you attach a video? Nothing is wrong on a cursory inspection.

yexiahua commented 9 years ago

on ios8 test. thank you xjk7_ g5 c6 _lksx q01 9

yangyang12138 commented 9 years ago

I also met.

grp commented 9 years ago

The issue is that the scale goes below zero, so it flips vertically. You'll want to use the clampMode property to clamp it to the end value when scaling down.

warpling commented 8 years ago

:+1: