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

Trim shape default type value #2478

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

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

Please also make this change in the Decodable init above

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.
Loading