Skip to content
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 infinite loop when setting LottieAnimationView.viewportFrame #2316

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

calda
Copy link
Member

@calda calda commented Feb 13, 2024

This PR fixes an issue where LottieAnimationView could crash due to an infinite loop of viewportFrame was set to a non-nil value. Fixes #2310.

This PR adds a test case that validates viewportFrame works correctly. We previously didn't have a test case for this, and I didn't even know that flag existed!

New test case:

"Issues/issue_2310": .customViewportFrame(
  CGRect(x: 0, y: 0, width: 85, height: 85).insetBy(dx: 10, dy: 10)),
Without viewportFrame With viewportFrame
testCoreAnimationRenderingEngine Issues-issue_2310-0 testCoreAnimationRenderingEngine Issues-issue_2310-0

@calda calda force-pushed the cal--viewportFrame branch from fe153c1 to 82ddf1a Compare February 14, 2024 23:26
@calda calda enabled auto-merge (squash) February 14, 2024 23:26
@calda calda merged commit 2f0f761 into master Feb 14, 2024
14 checks passed
@calda calda deleted the cal--viewportFrame branch February 14, 2024 23:48
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Feb 22, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | patch |
`from: "4.4.0"` -> `from: "4.4.1"` |

---

### Release Notes

<details>
<summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary>

###
[`v4.4.1`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.1)

[Compare
Source](https://togithub.com/airbnb/lottie-spm/compare/4.4.0...4.4.1)

##### Bug fixes in 4.4.1

- Replace os check with canImport so classes are available on visionOS
([https://github.com/airbnb/lottie-ios/pull/2294](https://togithub.com/airbnb/lottie-ios/pull/2294))
- Omit privacy manifest from source files in podspec
([https://github.com/airbnb/lottie-ios/pull/2307](https://togithub.com/airbnb/lottie-ios/pull/2307))
- Fix crash in Main Thread rendering engine path interpolation
implementation
([https://github.com/airbnb/lottie-ios/pull/2305](https://togithub.com/airbnb/lottie-ios/pull/2305))
- Fix warning from invalid character in Cocoapods resource bundle
identifier
([https://github.com/airbnb/lottie-ios/pull/2317](https://togithub.com/airbnb/lottie-ios/pull/2317))
- Fix infinite loop when setting `LottieAnimationView.viewportFrame`
([https://github.com/airbnb/lottie-ios/pull/2316](https://togithub.com/airbnb/lottie-ios/pull/2316))

##### New features in 4.4.0

- 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))

**Full Changelog**:
airbnb/lottie-ios@4.4.0...4.4.1

</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>
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LottieAnimationView layout stuck in infinite loop
2 participants