-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
FLIP Animations janky; inside a parent with transform:scale()
#3555
Comments
transform:scale()
transform:scale()
- divide the `getBoundingClientRect` dimensions by the `clientHeight` or `clientWidth` - this gives us the element's scaled values as `scaleX` and `scaleY` - divide the `dx` and `dy by the `scaleX` and `scaleY` This aims to fix sveltejs#3555 by using the `node`'s un-scaled width/height to calculate the amount it has been scaled. Then dividing the distance by this scale factor removes the janky start position which was shown in the test case. resolves sveltejs#3555
- divide the getBoundingClientRect dimensions by clientHeight or clientWidth - this gives us the element's scaled values as scaleX and scaleY - divide the "dx" and "dy" by the "scaleX" and "scaleY" This aims to fix sveltejs#3555 by using the node's un-scaled width/height to calculate the amount it has been scaled. Then dividing the distance by this scale factor removes the janky start position which was shown in the test case. resolves sveltejs#3555
hi @Conduitry ... I believe I have a fix for this issue in my branch; simeydotme@fbf4cbf I followed the instructions in the repo. I had an issue with the tests, though; I'm on windows and it seems that Pupeteer had problems launching Chrome post-test. Also two tests were failing before I touched any code: Aside from that everything went smoothly considering I've never touched TypeScript before; Testament to Svelte's simple structure and design! Below is the compare. Should I just submit a PR, or wait for someone to review this issue again? Thanks. |
Fix #3555 ; scale elements in FLIP animations
This issue is present again after #6658 |
Problem
When running FLIP animations on a list, if that list is inside of a parent with
transform: scale();
set to anything other than1
, it seems that the First position gets calculated wrongly and causes janky animations.Here's a reduced test case of the issue.
Reproduction Steps
transform: scale()
on the list parentTest Case
Please note that the
scale
value could be anything, but the problem's apparentness scales linearly with thescale
value; if it's<1
then the animation begins compressed, and if it's>1
then animation begins stretched.eg: if
scale == 0.99
it's barely noticeable. ifscale == 0.1
it's exaggerated.Expected behavior
I would expect that the FLIP animation can perform on an list which is scaled.
Logs
no error logsStacktraces
noneEnvironment
Severity
Low ... I can't imagine this is a common use case. But I also imagine it's simply a calculation oversight which could be resolved by multiplying the
distance * scale
Additional context
The text was updated successfully, but these errors were encountered: