Skip to content

Commit 81b2805

Browse files
alexallahcalda
andauthored
Update Trim.trimType to default to .individually if not provided (#2478)
Co-authored-by: Cal Stephens <[email protected]>
1 parent fc8a44f commit 81b2805

13 files changed

+8
-2
lines changed

Sources/Private/Model/ShapeItems/Trim.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class Trim: ShapeItem {
2323
start = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .start)
2424
end = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .end)
2525
offset = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .offset)
26-
trimType = try container.decode(TrimType.self, forKey: .trimType)
26+
trimType = try container.decodeIfPresent(TrimType.self, forKey: .trimType) ?? .individually
2727
try super.init(from: decoder)
2828
}
2929

@@ -34,7 +34,7 @@ final class Trim: ShapeItem {
3434
end = try KeyframeGroup<LottieVector1D>(dictionary: endDictionary)
3535
let offsetDictionary: [String: Any] = try dictionary.value(for: CodingKeys.offset)
3636
offset = try KeyframeGroup<LottieVector1D>(dictionary: offsetDictionary)
37-
let trimTypeRawValue: Int = try dictionary.value(for: CodingKeys.trimType)
37+
let trimTypeRawValue: Int = try dictionary.value(for: CodingKeys.trimType) ?? TrimType.individually.rawValue
3838
guard let trimType = TrimType(rawValue: trimTypeRawValue) else {
3939
throw InitializableError.invalidInput()
4040
}

Tests/Samples/Issues/pr_2478.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Does not support Core Animation engine. Encountered compatibility issues:
2+
[Body.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
3+
[Face.Vector 8.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
4+
[tail.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
5+
[hash.Layer.Layer] Rounded corners support is not currently implemented for combined shape items
59.2 KB
Loading
58.9 KB
Loading
59 KB
Loading
59.4 KB
Loading
59.3 KB
Loading
59.2 KB
Loading
58.9 KB
Loading

0 commit comments

Comments
 (0)