-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Fix issue where manually interpolated keyframes could animate incorrectly #2285
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calda
commented
Jan 8, 2024
|
||
init() { | ||
// Register fonts from the Samples/Fonts directory | ||
for fontAssetURL in Bundle.main.urls(forResourcesWithExtension: "ttf", subdirectory: "Samples/Fonts") ?? [] { |
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.
Unrelated to this bugfix -- I added a test case for #1939, since we didn't have any example animations that used custom fonts.
calda
changed the title
Fix issue where manually interpolates keyframes could animate incorrectly
Fix issue where manually interpolated keyframes could animate incorrectly
Jan 9, 2024
miguel-jimenez-0529
approved these changes
Jan 11, 2024
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.
LGTM
cgrindel-self-hosted-renovate bot
referenced
this pull request
in cgrindel/rules_swift_package_manager
Jan 23, 2024
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | minor | `from: "4.3.4"` -> `from: "4.4.0"` | --- ### Release Notes <details> <summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary> ### [`v4.4.0`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.0) [Compare Source](https://togithub.com/airbnb/lottie-spm/compare/4.3.4...4.4.0) #### New features - Add privacy manifest ([https://github.com/airbnb/lottie-ios/pull/2252](https://togithub.com/airbnb/lottie-ios/pull/2252)) - Codesign Lottie.xcframework ([https://github.com/airbnb/lottie-ios/pull/2259](https://togithub.com/airbnb/lottie-ios/pull/2259)) - Add time remapping support to Core Animation rendering engine ([https://github.com/airbnb/lottie-ios/pull/2286](https://togithub.com/airbnb/lottie-ios/pull/2286)) - Add official visionOS support to lottie-ios repo ([https://github.com/airbnb/lottie-ios/pull/2287](https://togithub.com/airbnb/lottie-ios/pull/2287)) - lottie-spm now supports visionOS ([https://github.com/airbnb/lottie-spm/pull/12](https://togithub.com/airbnb/lottie-spm/pull/12)) - Adopt policy on minimum supported Swift / Xcode version, update minimum versions to Swift 5.7 / Xcode 14.1 ([https://github.com/airbnb/lottie-ios/pull/2260](https://togithub.com/airbnb/lottie-ios/pull/2260)) #### Bug fixes - Update LottieView to display placeholder using `overlay` instead of `ZStack` ([https://github.com/airbnb/lottie-ios/pull/2289](https://togithub.com/airbnb/lottie-ios/pull/2289)) - Fix issue where Core Animation rendering engine couldn't display last frame of animation when paused ([https://github.com/airbnb/lottie-ios/pull/2254](https://togithub.com/airbnb/lottie-ios/pull/2254)) - Do not create `DotLottieImageProvider` instance if there's no image files ([https://github.com/airbnb/lottie-ios/pull/2271](https://togithub.com/airbnb/lottie-ios/pull/2271)) - Mark DotLottieCache as Sendable ([https://github.com/airbnb/lottie-ios/pull/2245](https://togithub.com/airbnb/lottie-ios/pull/2245)) - Fix issue where AnimationKeypath in SolidLayer could be incorrect ([https://github.com/airbnb/lottie-ios/pull/2278](https://togithub.com/airbnb/lottie-ios/pull/2278)) - Fix issue where Repeater could be displayed incorrectly ([https://github.com/airbnb/lottie-ios/pull/2276](https://togithub.com/airbnb/lottie-ios/pull/2276)) - Include dSYMs in xcframework build ([https://github.com/airbnb/lottie-ios/pull/2284](https://togithub.com/airbnb/lottie-ios/pull/2284)) - Fix parsing issue, add support for DotLottieConfiguration in SwiftUI LottieView ([https://github.com/airbnb/lottie-ios/pull/2277](https://togithub.com/airbnb/lottie-ios/pull/2277)) - Fix issue where DotLottieImageProvider didn't handle base64 images ([https://github.com/airbnb/lottie-ios/pull/2283](https://togithub.com/airbnb/lottie-ios/pull/2283)) - Fix issue where manually interpolated keyframes could animate incorrectly ([https://github.com/airbnb/lottie-ios/pull/2285](https://togithub.com/airbnb/lottie-ios/pull/2285)) **Full Changelog**: airbnb/lottie-ios@4.3.4...4.4.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
iago849
pushed a commit
to atteamapps/lottie-ios
that referenced
this pull request
Feb 8, 2024
MoroziOS
pushed a commit
to MoroziOS/tmg-lottie-ios
that referenced
this pull request
May 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some cases we manually interpolate keyframes rather than letting Core Animation perform the interpolation. To do this we create a CAAnimation keyframe for each frame in the animation. This lets us work around issues where Core Animation interpolation behaves in unexpected ways, or doesn't support certain functionality.
Previously, we allowed Core Animation to additionally interpolate between these manual frames. For example, on frame 19.5 Core Animation would itself interpolate half way between our manually generated keyframes for frame 19 and frame 20. This is undesirable, since we are intentionally not using Core Animation interpolation in these cases.
Instead, we can set
isHold: true
on the generated keyframes (to indicate that they shouldn't animate) and instead just increase the number of times that we generate a keyframe for to make sure these static keyframes still appear to animate smoothly.Fixes #2226: