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 issue where layers with negative X scale values could be pixelated #2067

Merged
merged 8 commits into from
May 20, 2023

Conversation

calda
Copy link
Member

@calda calda commented May 16, 2023

This PR fixes an issue where layers with negative X scale values could be pixelated. Fixes #2066.

Core Animation doesn't support negative X scale values when animating transform.scale.x and transform.scale.y separately (https://openradar.appspot.com/FB9862872).

Previously we worked around this by applying a 180º rotation around the Y axis when scale.x is negative, which has the same effect. This seems to affect the display quality of layers under some circumstances (no clue why), though. This also didn't work in snapshot tests for some reason, which was inconvenient.

Instead, we now handle negative X scale values by combining all of the transform components into a single set of keyframes, which we apply to layer.transform. This works perfectly and doesn't have any of the issues we encountered with the other approach.

Before After
Simulator Screenshot - iPhone 14 Pro - 2023-05-16 at 13 19 29 Simulator Screenshot - iPhone 14 Pro - 2023-05-16 at 13 20 25

/// Combines the given keyframe groups of `Keyframe<T>`s into a single keyframe group of of `Keyframe<[T]>`s
/// - If all of the `KeyframeGroup`s have the exact same animation timing, the keyframes are merged
/// - Otherwise, the keyframes are manually interpolated at each frame in the animation
static func combined<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, CombinedResult>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are variadic generics coming in Swift 5.9?????????

@calda calda mentioned this pull request May 16, 2023
@calda calda merged commit df55b4c into master May 20, 2023
@calda calda deleted the cal--2066 branch May 20, 2023 04:09
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 15, 2023
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | minor |
`from: "4.2.0"` -> `from: "4.3.0"` |

---

### Release Notes

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

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

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

**Lottie 4.3.0** adds many new features, including:

-   Official support for SwiftUI!
-   A public Core Animation `CALayer` subclass
-   Support for reduced motion
-   Support for drop shadow layer effects
-   Support for visionOS in the lottie-ios repo

You can learn more about Lottie 4.3.0 in this announcement: **[Lottie
4.3.0 now available, with official support for SwiftUI
#&#8203;2189](https://togithub.com/airbnb/lottie-ios/discussions/2189)**

#### New Features

-   Add SwiftUI `LottieView`, which wraps UIKit `LottieAnimationView`
- Add SwiftUI `LottieSwitch`, which wraps UIKit `AnimatedSwitch`
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138))
- Add SwiftUI `LottieButton`, which wraps `AnimatedButton`
([https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- `AnimatedSwitch` and `AnimatedButton` now support macOS
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138),
[https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- Add `LottieAnimationLayer`, a Core Animation `CALayer` subclass for
playing Lottie animations
([https://github.com/airbnb/lottie-ios/pull/2073](https://togithub.com/airbnb/lottie-ios/pull/2073))
- Add support for rendering drop shadow layer effects
([https://github.com/airbnb/lottie-ios/pull/2142](https://togithub.com/airbnb/lottie-ios/pull/2142))
- Add API for playing multiple markers sequentially
([https://github.com/airbnb/lottie-ios/pull/2084](https://togithub.com/airbnb/lottie-ios/pull/2084))
- Play "reduced motion" marker if
`UIAccessibility.isReduceMotionEnabled` is true
([https://github.com/airbnb/lottie-ios/pull/2110](https://togithub.com/airbnb/lottie-ios/pull/2110))
- Update text provider API to use full `AnimationKeypath` values
([https://github.com/airbnb/lottie-ios/pull/2183](https://togithub.com/airbnb/lottie-ios/pull/2183))
- Add support for visionOS to lottie-ios repo
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Drop support for Swift 5.5
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Add contents gravity configuration to `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2177](https://togithub.com/airbnb/lottie-ios/pull/2177))
- Add support for customizing stroke width values using
`FloatValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2179](https://togithub.com/airbnb/lottie-ios/pull/2179))
- Adopt `Sendable` to support using Lottie with strict concurrency
enabled
([https://github.com/airbnb/lottie-ios/pull/2126](https://togithub.com/airbnb/lottie-ios/pull/2126))
- Add `LottiePlaybackMode` to support declarative playback configuration
([https://github.com/airbnb/lottie-ios/pull/2128](https://togithub.com/airbnb/lottie-ios/pull/2128))
- Add option make main thread rendering engine force display update on
every frame
([https://github.com/airbnb/lottie-ios/pull/2168](https://togithub.com/airbnb/lottie-ios/pull/2168))
- Add a option to prevent caching images from `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2171](https://togithub.com/airbnb/lottie-ios/pull/2171))
- Add support for customizing gradient values using
`GradientValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2182](https://togithub.com/airbnb/lottie-ios/pull/2182))
- Added additional support for multiple animations in `DotLottieFile`
([https://github.com/airbnb/lottie-ios/pull/2074](https://togithub.com/airbnb/lottie-ios/pull/2074))
- Add helper method to initialize `DotLottieFile` with data
([https://github.com/airbnb/lottie-ios/pull/2090](https://togithub.com/airbnb/lottie-ios/pull/2090))

#### Bug fixes

- Remove `.../ZipFoundation/README.md` from targets and `*.md*` files
from podspec
([https://github.com/airbnb/lottie-ios/pull/2057](https://togithub.com/airbnb/lottie-ios/pull/2057))\*
- Fix issue where layers with negative X scale values could be pixelated
([https://github.com/airbnb/lottie-ios/pull/2067](https://togithub.com/airbnb/lottie-ios/pull/2067))
- Fix warnings when building with Swift 5.9
([https://github.com/airbnb/lottie-ios/pull/2072](https://togithub.com/airbnb/lottie-ios/pull/2072))
- Restructure `ValueProviderStore` to not accumulate multiple values for
the same key
([https://github.com/airbnb/lottie-ios/pull/2082](https://togithub.com/airbnb/lottie-ios/pull/2082))
- Disable bitcode when building XCFramework
([https://github.com/airbnb/lottie-ios/pull/2121](https://togithub.com/airbnb/lottie-ios/pull/2121))
- Fix unhandled file warning when building with SPM
([https://github.com/airbnb/lottie-ios/pull/213](https://togithub.com/airbnb/lottie-ios/pull/2132))
- Fix support for customizing color of `SolidLayer` using
`ColorValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2154](https://togithub.com/airbnb/lottie-ios/pull/2154))
- Fix issue where shape items could be unexpectedly ignored
([https://github.com/airbnb/lottie-ios/pull/2156](https://togithub.com/airbnb/lottie-ios/pull/2156))
- Fix issue where skew keyframes would unexpectedly not animate
([https://github.com/airbnb/lottie-ios/pull/2157](https://togithub.com/airbnb/lottie-ios/pull/2157))
- Fix issue where value providers could be ignored when falling back to
main thread rendering engine
([https://github.com/airbnb/lottie-ios/pull/2164](https://togithub.com/airbnb/lottie-ios/pull/2164))

Thanks to everyone who contributed to this release!

</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:eyJjcmVhdGVkSW5WZXIiOiIzNi45My4wIiwidXBkYXRlZEluVmVyIjoiMzYuOTMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 22, 2023
This PR contains the following updates:

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

---

### Release Notes

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

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

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

**Lottie 4.3.0** adds many new features, including:

-   Official support for SwiftUI!
-   A public Core Animation `CALayer` subclass
-   Support for reduced motion
-   Support for drop shadow layer effects
-   Support for visionOS

You can learn more about Lottie 4.3.0 in this announcement: **[Lottie
4.3.0 now available, with official support for SwiftUI
#&#8203;2189](https://togithub.com/airbnb/lottie-ios/discussions/2189)**

Lottie 4.3.1 fixes a small regression introduced by 4.3.0:
[https://github.com/airbnb/lottie-ios/issues/2193](https://togithub.com/airbnb/lottie-ios/issues/2193)

#### New Features

-   Add SwiftUI `LottieView`, which wraps UIKit `LottieAnimationView`
- Add SwiftUI `LottieSwitch`, which wraps UIKit `AnimatedSwitch`
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138))
- Add SwiftUI `LottieButton`, which wraps `AnimatedButton`
([https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- `AnimatedSwitch` and `AnimatedButton` now support macOS
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138),
[https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- Add `LottieAnimationLayer`, a Core Animation `CALayer` subclass for
playing Lottie animations
([https://github.com/airbnb/lottie-ios/pull/2073](https://togithub.com/airbnb/lottie-ios/pull/2073))
- Add support for rendering drop shadow layer effects
([https://github.com/airbnb/lottie-ios/pull/2142](https://togithub.com/airbnb/lottie-ios/pull/2142))
- Add API for playing multiple markers sequentially
([https://github.com/airbnb/lottie-ios/pull/2084](https://togithub.com/airbnb/lottie-ios/pull/2084))
- Play "reduced motion" marker if
`UIAccessibility.isReduceMotionEnabled` is true
([https://github.com/airbnb/lottie-ios/pull/2110](https://togithub.com/airbnb/lottie-ios/pull/2110))
- Update text provider API to use full `AnimationKeypath` values
([https://github.com/airbnb/lottie-ios/pull/2183](https://togithub.com/airbnb/lottie-ios/pull/2183))
- Add support for visionOS
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Drop support for Swift 5.5
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Add contents gravity configuration to `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2177](https://togithub.com/airbnb/lottie-ios/pull/2177))
- Add support for customizing stroke width values using
`FloatValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2179](https://togithub.com/airbnb/lottie-ios/pull/2179))
- Adopt `Sendable` to support using Lottie with strict concurrency
enabled
([https://github.com/airbnb/lottie-ios/pull/2126](https://togithub.com/airbnb/lottie-ios/pull/2126))
- Add `LottiePlaybackMode` to support declarative playback configuration
([https://github.com/airbnb/lottie-ios/pull/2128](https://togithub.com/airbnb/lottie-ios/pull/2128))
- Add option make main thread rendering engine force display update on
every frame
([https://github.com/airbnb/lottie-ios/pull/2168](https://togithub.com/airbnb/lottie-ios/pull/2168))
- Add a option to prevent caching images from `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2171](https://togithub.com/airbnb/lottie-ios/pull/2171))
- Add support for customizing gradient values using
`GradientValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2182](https://togithub.com/airbnb/lottie-ios/pull/2182))
- Added additional support for multiple animations in `DotLottieFile`
([https://github.com/airbnb/lottie-ios/pull/2074](https://togithub.com/airbnb/lottie-ios/pull/2074))
- Add helper method to initialize `DotLottieFile` with data
([https://github.com/airbnb/lottie-ios/pull/2090](https://togithub.com/airbnb/lottie-ios/pull/2090))

#### Bug fixes

- Remove `.../ZipFoundation/README.md` from targets and `*.md*` files
from podspec
([https://github.com/airbnb/lottie-ios/pull/2057](https://togithub.com/airbnb/lottie-ios/pull/2057))\*
- Fix issue where layers with negative X scale values could be pixelated
([https://github.com/airbnb/lottie-ios/pull/2067](https://togithub.com/airbnb/lottie-ios/pull/2067))
- Fix warnings when building with Swift 5.9
([https://github.com/airbnb/lottie-ios/pull/2072](https://togithub.com/airbnb/lottie-ios/pull/2072))
- Restructure `ValueProviderStore` to not accumulate multiple values for
the same key
([https://github.com/airbnb/lottie-ios/pull/2082](https://togithub.com/airbnb/lottie-ios/pull/2082))
- Disable bitcode when building XCFramework
([https://github.com/airbnb/lottie-ios/pull/2121](https://togithub.com/airbnb/lottie-ios/pull/2121))
- Fix unhandled file warning when building with SPM
([https://github.com/airbnb/lottie-ios/pull/213](https://togithub.com/airbnb/lottie-ios/pull/2132))
- Fix support for customizing color of `SolidLayer` using
`ColorValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2154](https://togithub.com/airbnb/lottie-ios/pull/2154))
- Fix issue where shape items could be unexpectedly ignored
([https://github.com/airbnb/lottie-ios/pull/2156](https://togithub.com/airbnb/lottie-ios/pull/2156))
- Fix issue where skew keyframes would unexpectedly not animate
([https://github.com/airbnb/lottie-ios/pull/2157](https://togithub.com/airbnb/lottie-ios/pull/2157))
- Fix issue where value providers could be ignored when falling back to
main thread rendering engine
([https://github.com/airbnb/lottie-ios/pull/2164](https://togithub.com/airbnb/lottie-ios/pull/2164))

Thanks to everyone who contributed to this release!

</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>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 27, 2023
This PR contains the following updates:

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

---

### Release Notes

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

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

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

**Lottie 4.3.0** adds many new features, including:

-   Official support for SwiftUI!
-   A public Core Animation `CALayer` subclass
-   Support for reduced motion
-   Support for drop shadow layer effects
-   Support for visionOS in the lottie-ios rep

You can learn more about Lottie 4.3.0 in this announcement: **[Lottie
4.3.0 now available, with official support for SwiftUI
#&#8203;2189](https://togithub.com/airbnb/lottie-ios/discussions/2189)**

#### Lottie 4.3.2

Lottie 4.3.2 redesigns the `LottiePlaybackMode` playback APIs that were
introduced in Lottie 4.3.0.

##### Before

```swift
// Loop from 0.5 to 1.0
LottieView(animation: myAnimation)
  .play(.fromProgress(0.5, toProgress: 1.0, loopMode: .loop))

// Pause at the halfway point of the animation
LottieView(animation: myAnimation)
  .play(.progress(0.5))
```

##### After

```swift
// Loop from 0.5 to 1.0
LottieView(animation: myAnimation)
  .playing(.fromProgress(0.5, toProgress: 1.0, loopMode: .loop))

// Pause at the halfway point of the animation
LottieView(animation: myAnimation)
  .paused(at: .progress(0.5))
```

#### New Features in Lottie 4.3.0

-   Add SwiftUI `LottieView`, which wraps UIKit `LottieAnimationView`
- Add SwiftUI `LottieSwitch`, which wraps UIKit `AnimatedSwitch`
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138))
- Add SwiftUI `LottieButton`, which wraps `AnimatedButton`
([https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- `AnimatedSwitch` and `AnimatedButton` now support macOS
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138),
[https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- Add `LottieAnimationLayer`, a Core Animation `CALayer` subclass for
playing Lottie animations
([https://github.com/airbnb/lottie-ios/pull/2073](https://togithub.com/airbnb/lottie-ios/pull/2073))
- Add support for rendering drop shadow layer effects
([https://github.com/airbnb/lottie-ios/pull/2142](https://togithub.com/airbnb/lottie-ios/pull/2142))
- Add API for playing multiple markers sequentially
([https://github.com/airbnb/lottie-ios/pull/2084](https://togithub.com/airbnb/lottie-ios/pull/2084))
- Play "reduced motion" marker if
`UIAccessibility.isReduceMotionEnabled` is true
([https://github.com/airbnb/lottie-ios/pull/2110](https://togithub.com/airbnb/lottie-ios/pull/2110))
- Update text provider API to use full `AnimationKeypath` values
([https://github.com/airbnb/lottie-ios/pull/2183](https://togithub.com/airbnb/lottie-ios/pull/2183))
- Add support for visionOS
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Drop support for Swift 5.5
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Add contents gravity configuration to `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2177](https://togithub.com/airbnb/lottie-ios/pull/2177))
- Add support for customizing stroke width values using
`FloatValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2179](https://togithub.com/airbnb/lottie-ios/pull/2179))
- Adopt `Sendable` to support using Lottie with strict concurrency
enabled
([https://github.com/airbnb/lottie-ios/pull/2126](https://togithub.com/airbnb/lottie-ios/pull/2126))
- Add `LottiePlaybackMode` to support declarative playback configuration
([https://github.com/airbnb/lottie-ios/pull/2128](https://togithub.com/airbnb/lottie-ios/pull/2128))
- Add option make main thread rendering engine force display update on
every frame
([https://github.com/airbnb/lottie-ios/pull/2168](https://togithub.com/airbnb/lottie-ios/pull/2168))
- Add a option to prevent caching images from `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2171](https://togithub.com/airbnb/lottie-ios/pull/2171))
- Add support for customizing gradient values using
`GradientValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2182](https://togithub.com/airbnb/lottie-ios/pull/2182))
- Added additional support for multiple animations in `DotLottieFile`
([https://github.com/airbnb/lottie-ios/pull/2074](https://togithub.com/airbnb/lottie-ios/pull/2074))
- Add helper method to initialize `DotLottieFile` with data
([https://github.com/airbnb/lottie-ios/pull/2090](https://togithub.com/airbnb/lottie-ios/pull/2090))

#### Bug fixes

- Remove `.../ZipFoundation/README.md` from targets and `*.md*` files
from podspec
([https://github.com/airbnb/lottie-ios/pull/2057](https://togithub.com/airbnb/lottie-ios/pull/2057))\*
- Fix issue where layers with negative X scale values could be pixelated
([https://github.com/airbnb/lottie-ios/pull/2067](https://togithub.com/airbnb/lottie-ios/pull/2067))
- Fix warnings when building with Swift 5.9
([https://github.com/airbnb/lottie-ios/pull/2072](https://togithub.com/airbnb/lottie-ios/pull/2072))
- Restructure `ValueProviderStore` to not accumulate multiple values for
the same key
([https://github.com/airbnb/lottie-ios/pull/2082](https://togithub.com/airbnb/lottie-ios/pull/2082))
- Disable bitcode when building XCFramework
([https://github.com/airbnb/lottie-ios/pull/2121](https://togithub.com/airbnb/lottie-ios/pull/2121))
- Fix unhandled file warning when building with SPM
([https://github.com/airbnb/lottie-ios/pull/213](https://togithub.com/airbnb/lottie-ios/pull/2132))
- Fix support for customizing color of `SolidLayer` using
`ColorValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2154](https://togithub.com/airbnb/lottie-ios/pull/2154))
- Fix issue where shape items could be unexpectedly ignored
([https://github.com/airbnb/lottie-ios/pull/2156](https://togithub.com/airbnb/lottie-ios/pull/2156))
- Fix issue where skew keyframes would unexpectedly not animate
([https://github.com/airbnb/lottie-ios/pull/2157](https://togithub.com/airbnb/lottie-ios/pull/2157))
- Fix issue where value providers could be ignored when falling back to
main thread rendering engine
([https://github.com/airbnb/lottie-ios/pull/2164](https://togithub.com/airbnb/lottie-ios/pull/2164))

Thanks to everyone who contributed to this release!

</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>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 30, 2023
This PR contains the following updates:

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

---

### Release Notes

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

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

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

**Lottie 4.3.0** adds many new features, including:

-   Official support for SwiftUI!
-   A public Core Animation `CALayer` subclass
-   Support for reduced motion
-   Support for drop shadow layer effects
-   Support for visionOS

You can learn more about Lottie 4.3.0 in this announcement: **[Lottie
4.3.0 now available, with official support for SwiftUI
#&#8203;2189](https://togithub.com/airbnb/lottie-ios/discussions/2189)**

Lottie 4.3.3 fixes a regression introduced by Lottie 4.3.0 where the
contents of a `LottieAnimationView` could crossfade / animate
unexpectedly when updating the current `LottieAnimation` or rendering
engine:
[https://github.com/airbnb/lottie-ios/issues/2200](https://togithub.com/airbnb/lottie-ios/issues/2200)

#### New Features in Lottie 4.3.0

-   Add SwiftUI `LottieView`, which wraps UIKit `LottieAnimationView`
- Add SwiftUI `LottieSwitch`, which wraps UIKit `AnimatedSwitch`
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138))
- Add SwiftUI `LottieButton`, which wraps `AnimatedButton`
([https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- `AnimatedSwitch` and `AnimatedButton` now support macOS
([https://github.com/airbnb/lottie-ios/pull/2138](https://togithub.com/airbnb/lottie-ios/pull/2138),
[https://github.com/airbnb/lottie-ios/pull/2139](https://togithub.com/airbnb/lottie-ios/pull/2139))
- Add `LottieAnimationLayer`, a Core Animation `CALayer` subclass for
playing Lottie animations
([https://github.com/airbnb/lottie-ios/pull/2073](https://togithub.com/airbnb/lottie-ios/pull/2073))
- Add support for rendering drop shadow layer effects
([https://github.com/airbnb/lottie-ios/pull/2142](https://togithub.com/airbnb/lottie-ios/pull/2142))
- Add API for playing multiple markers sequentially
([https://github.com/airbnb/lottie-ios/pull/2084](https://togithub.com/airbnb/lottie-ios/pull/2084))
- Play "reduced motion" marker if
`UIAccessibility.isReduceMotionEnabled` is true
([https://github.com/airbnb/lottie-ios/pull/2110](https://togithub.com/airbnb/lottie-ios/pull/2110))
- Update text provider API to use full `AnimationKeypath` values
([https://github.com/airbnb/lottie-ios/pull/2183](https://togithub.com/airbnb/lottie-ios/pull/2183))
- Add support for visionOS
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Drop support for Swift 5.5
([https://github.com/airbnb/lottie-ios/pull/2152](https://togithub.com/airbnb/lottie-ios/pull/2152))
- Add contents gravity configuration to `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2177](https://togithub.com/airbnb/lottie-ios/pull/2177))
- Add support for customizing stroke width values using
`FloatValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2179](https://togithub.com/airbnb/lottie-ios/pull/2179))
- Adopt `Sendable` to support using Lottie with strict concurrency
enabled
([https://github.com/airbnb/lottie-ios/pull/2126](https://togithub.com/airbnb/lottie-ios/pull/2126))
- Add `LottiePlaybackMode` to support declarative playback configuration
([https://github.com/airbnb/lottie-ios/pull/2128](https://togithub.com/airbnb/lottie-ios/pull/2128))
- Add option make main thread rendering engine force display update on
every frame
([https://github.com/airbnb/lottie-ios/pull/2168](https://togithub.com/airbnb/lottie-ios/pull/2168))
- Add a option to prevent caching images from `AnimationImageProvider`
([https://github.com/airbnb/lottie-ios/pull/2171](https://togithub.com/airbnb/lottie-ios/pull/2171))
- Add support for customizing gradient values using
`GradientValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2182](https://togithub.com/airbnb/lottie-ios/pull/2182))
- Added additional support for multiple animations in `DotLottieFile`
([https://github.com/airbnb/lottie-ios/pull/2074](https://togithub.com/airbnb/lottie-ios/pull/2074))
- Add helper method to initialize `DotLottieFile` with data
([https://github.com/airbnb/lottie-ios/pull/2090](https://togithub.com/airbnb/lottie-ios/pull/2090))

#### Bug fixes

- Remove `.../ZipFoundation/README.md` from targets and `*.md*` files
from podspec
([https://github.com/airbnb/lottie-ios/pull/2057](https://togithub.com/airbnb/lottie-ios/pull/2057))\*
- Fix issue where layers with negative X scale values could be pixelated
([https://github.com/airbnb/lottie-ios/pull/2067](https://togithub.com/airbnb/lottie-ios/pull/2067))
- Fix warnings when building with Swift 5.9
([https://github.com/airbnb/lottie-ios/pull/2072](https://togithub.com/airbnb/lottie-ios/pull/2072))
- Restructure `ValueProviderStore` to not accumulate multiple values for
the same key
([https://github.com/airbnb/lottie-ios/pull/2082](https://togithub.com/airbnb/lottie-ios/pull/2082))
- Disable bitcode when building XCFramework
([https://github.com/airbnb/lottie-ios/pull/2121](https://togithub.com/airbnb/lottie-ios/pull/2121))
- Fix unhandled file warning when building with SPM
([https://github.com/airbnb/lottie-ios/pull/213](https://togithub.com/airbnb/lottie-ios/pull/2132))
- Fix support for customizing color of `SolidLayer` using
`ColorValueProvider`
([https://github.com/airbnb/lottie-ios/pull/2154](https://togithub.com/airbnb/lottie-ios/pull/2154))
- Fix issue where shape items could be unexpectedly ignored
([https://github.com/airbnb/lottie-ios/pull/2156](https://togithub.com/airbnb/lottie-ios/pull/2156))
- Fix issue where skew keyframes would unexpectedly not animate
([https://github.com/airbnb/lottie-ios/pull/2157](https://togithub.com/airbnb/lottie-ios/pull/2157))
- Fix issue where value providers could be ignored when falling back to
main thread rendering engine
([https://github.com/airbnb/lottie-ios/pull/2164](https://togithub.com/airbnb/lottie-ios/pull/2164))

Thanks to everyone who contributed to this release!

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

Successfully merging this pull request may close these issues.

Pixellated Shape Layers
2 participants