Comments (5)
This is not a pop specific behaviour.
You can't create a transform matrix of 0 like this. CGAffineTransformMakeScale(0.0, 0.0);
I believe that the problem is that your matrix cannot be inverted when it has a 0.0 scale, but it CAN when you have a 0.001 scale. You'll run in all kinds of nasty divide by zero errors when inverting that matrix.
from pop.
Thanks for the report. The best workaround, and in fact what we've employed in Paper, is to replace zero with a minuscule, but not-quite-zero scale value.
from pop.
@depl0y I'm converting some code that currently uses JNWSpringAnimation just to get my feet a little wet and it works fine with a starting scale of 0.0.
myButton.transform = CGAffineTransformMakeScale(0.0, 0.0);
JNWSpringAnimation *decay = [JNWSpringAnimation animationWithKeyPath:@"transform.scale"];
decay.damping = 35;
decay.stiffness = 1000;
decay.mass = 3;
decay.fromValue = @(0);
decay.toValue = @(1);
[myButton.layer addAnimation:decay forKey:@"transform.scale"];
Of course I'm by no means a matrix transformation expert so perhaps Jonathan has a special case in his code to change a 0 to a very small but non-zero number. Not sure.
@kimon Thanks! I'd say that a nice-to-have would be to notice this starting-at-0.0f-scale use case and adjust to something very small automatically, but that's probably more of a hack than something that'd belong in a library like this. Feel free to re-open if you think it's worth updating.
from pop.
Ran into this and the above was helpful! Wanted to add an additional case for those who find it in the future:
When animating using a POPSpringAnimation, the spirngyness causes the scale to go below (0,0), which inverts things as described above.
To remedy this, you can apply a clampMode
to prevent it from dipping below 0,0
thanks!
from pop.
不明觉厉
from pop.
Related Issues (20)
- paper link does not exist
- Couldnt be able to integrate this with Swift 3.0 project by following the same commands. HOT 1
- No such file or directory error while building the workspace
- Errors should be thrown when animation parameters don't match animation parameters
- In memory of the Facebook Paper HOT 1
- Why not kPOPLayerRotationZ this enumeration? I want to rotate the animation around the Z axis. HOT 2
- Cannot works with Snapkit?
- Do you have the scenekit+pop demo?
- iostream file not found - Xcode 9.3.1 - Swift 4 HOT 3
- How to get the progress of the animation
- _POPPropertyAnimationState isPaused reset the progress
- Installation
- CocoaPods update HOT 5
- If toValue equals the target's current value then completionBlock will fire immediately HOT 1
- Carthage issue HOT 1
- problem with same animation HOT 1
- i feel confused ,what the function work for ‘ [self _scheduleProcessPendingList]’
- POPSpringAnimation removedOnCompletion not working
- Spring animation not working anymore following iOS 13 update HOT 5
- Swift Package Manager Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pop.