Skip to content

Conversation

@simeydotme
Copy link
Contributor

@simeydotme simeydotme commented Jan 31, 2022

The issue #7205 describes how FLIP animations occurring inside a parent with transform: scale(n) are wonky, this PR resolves that issue by;

  • Geting the scale factor by comparing against node.clientWidth
  • Dividing all the positions/dimensions by the scale to get the correct deltas

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.

Tests

  • Run the tests with npm test and lint the project with npm run lint
  • Ideally, include a test that fails without this PR but passes with it.

(I haven't added a test, as I don't really understand how the animate tests are working, and I couldn't find an example in the #6658 commit which caused this regression. If anyone wants to walk me through creating a test, or help append a test to this PR, please let me know! :))


@simeydotme
Copy link
Contributor Author

looks like one test took too long to execute... can't find a "retry" button :/

simeydotme and others added 2 commits March 13, 2022 03:40
- get the scale factor by comparing against node.clientWidth
- divide all the positions/dimensions by the scale to get the correct
deltas

- resolves sveltejs#7205
- fixes regression from sveltejs#6658
incorporate the suggested change from @Conduitry

Co-authored-by: Conduitry <git@chor.date>
@simeydotme simeydotme force-pushed the fix-flip-scaled-parent branch from 2fdb9e4 to 546d09d Compare March 12, 2022 19:41
@simeydotme
Copy link
Contributor Author

I rebased to try and trigger the CI again, as last time it timed-out on an osx test, and I couldn't re-run the tests ... and I wondered if the failed CI meant the PR would be glossed over during review :)

@simeydotme
Copy link
Contributor Author

oh cool the checks pass now... I guess the failing tests were fixed in main :)

@simeydotme simeydotme requested a review from Conduitry May 2, 2022 10:15
@dummdidumm dummdidumm added this to the 3.x milestone Mar 2, 2023
@benmccann benmccann changed the title [fix] Allow FLIP animations perform correctly in scaled parent fix: correct FLIP animations in scaled parent Mar 14, 2023
@dummdidumm dummdidumm modified the milestones: 3.x, one day Apr 28, 2023
@Rich-Harris
Copy link
Member

Thank you for the fix — unfortunately this got out of date as the flip function was updated for Svelte 5, and the changes don't directly translate (pun intended). I've opened #14957 instead

@Rich-Harris Rich-Harris closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FLIP Animations inside a Scaled Parent are calculated incorrectly

4 participants