-
Notifications
You must be signed in to change notification settings - Fork 1k
[labs/motion] Fix transforms when scaling to or from zero #3886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: cad8548 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
|
ping @sorvell |
packages/labs/motion/src/animate.ts
Outdated
| op['transform'] | ||
| }`; | ||
| if (op.override !== undefined) { | ||
| Object.assign(fromFrame, op.override); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromFrame and override should probably have more descriptive names here
fromFrame is more like, transformToIntoFromFrame, and override is specifically overriding that
Fixes #3486
When scaling to zero with FLIP you need to scale to a small number instead so that you can calculate a finite inverse transform. Luckily we can do this by passing a small override value in the first keyframe of the animation. In this fix we scale to 1px and when the animation ends it'll pop to 0.