Skip to content

Commit

Permalink
Update Trim.trimType to default to .individually if not provided (#2478)
Browse files Browse the repository at this point in the history
Co-authored-by: Cal Stephens <[email protected]>
  • Loading branch information
alexallah and calda authored Sep 13, 2024
1 parent fc8a44f commit 81b2805
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Private/Model/ShapeItems/Trim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class Trim: ShapeItem {
start = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .start)
end = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .end)
offset = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .offset)
trimType = try container.decode(TrimType.self, forKey: .trimType)
trimType = try container.decodeIfPresent(TrimType.self, forKey: .trimType) ?? .individually
try super.init(from: decoder)
}

Expand All @@ -34,7 +34,7 @@ final class Trim: ShapeItem {
end = try KeyframeGroup<LottieVector1D>(dictionary: endDictionary)
let offsetDictionary: [String: Any] = try dictionary.value(for: CodingKeys.offset)
offset = try KeyframeGroup<LottieVector1D>(dictionary: offsetDictionary)
let trimTypeRawValue: Int = try dictionary.value(for: CodingKeys.trimType)
let trimTypeRawValue: Int = try dictionary.value(for: CodingKeys.trimType) ?? TrimType.individually.rawValue
guard let trimType = TrimType(rawValue: trimTypeRawValue) else {
throw InitializableError.invalidInput()
}
Expand Down
1 change: 1 addition & 0 deletions Tests/Samples/Issues/pr_2478.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Does not support Core Animation engine. Encountered compatibility issues:
[Body.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
[Face.Vector 8.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
[tail.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
[hash.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 81b2805

Please sign in to comment.