lottie-ios 3.4.3 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +0 -11
- package/Lottie.xcodeproj/project.pbxproj +58 -58
- package/Lottie.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +22 -0
- package/Lottie.xcworkspace/xcshareddata/swiftpm/Package.resolved +2 -2
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +1 -1
- package/Sources/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +10 -7
- package/Sources/Private/CoreAnimation/Animations/EllipseAnimation.swift +2 -2
- package/Sources/Private/CoreAnimation/Animations/GradientAnimations.swift +2 -2
- package/Sources/Private/CoreAnimation/Animations/LayerProperty.swift +2 -2
- package/Sources/Private/CoreAnimation/Animations/OpacityAnimation.swift +1 -1
- package/Sources/Private/CoreAnimation/Animations/RectangleAnimation.swift +3 -3
- package/Sources/Private/CoreAnimation/Animations/ShapeAnimation.swift +16 -16
- package/Sources/Private/CoreAnimation/Animations/StarAnimation.swift +11 -11
- package/Sources/Private/CoreAnimation/Animations/StrokeAnimation.swift +4 -4
- package/Sources/Private/CoreAnimation/Animations/TransformAnimations.swift +13 -13
- package/Sources/Private/CoreAnimation/CoreAnimationLayer.swift +3 -3
- package/Sources/Private/CoreAnimation/Layers/AnimationLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/PreCompLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/RepeaterLayer.swift +9 -9
- package/Sources/Private/CoreAnimation/Layers/ShapeLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/ValueProviderStore.swift +1 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +2 -2
- package/Sources/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +1 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +2 -2
- package/Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +3 -3
- package/Sources/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +10 -10
- package/Sources/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +3 -3
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +2 -2
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +5 -5
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +3 -3
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +9 -9
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +14 -14
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +2 -2
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +3 -3
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +10 -10
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +14 -14
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +11 -11
- package/Sources/Private/Model/Keyframes/KeyframeData.swift +12 -12
- package/Sources/Private/Model/Layers/PreCompLayerModel.swift +3 -3
- package/Sources/Private/Model/Objects/DashPattern.swift +2 -2
- package/Sources/Private/Model/Objects/Marker.swift +4 -0
- package/Sources/Private/Model/Objects/Mask.swift +10 -8
- package/Sources/Private/Model/Objects/Transform.swift +39 -35
- package/Sources/Private/Model/ShapeItems/Ellipse.swift +6 -6
- package/Sources/Private/Model/ShapeItems/Fill.swift +6 -6
- package/Sources/Private/Model/ShapeItems/GradientFill.swift +15 -15
- package/Sources/Private/Model/ShapeItems/GradientStroke.swift +18 -18
- package/Sources/Private/Model/ShapeItems/Rectangle.swift +9 -9
- package/Sources/Private/Model/ShapeItems/Repeater.swift +37 -32
- package/Sources/Private/Model/ShapeItems/ShapeTransform.swift +34 -28
- package/Sources/Private/Model/ShapeItems/Star.swift +21 -21
- package/Sources/Private/Model/ShapeItems/Stroke.swift +9 -9
- package/Sources/Private/Model/ShapeItems/Trim.swift +9 -9
- package/Sources/Private/Model/Text/TextAnimator.swift +33 -33
- package/Sources/Private/Model/Text/TextDocument.swift +8 -8
- package/Sources/Private/RootAnimationLayer.swift +4 -4
- package/Sources/Private/Utility/Interpolatable/InterpolatableExtensions.swift +1 -1
- package/Sources/Private/Utility/Interpolatable/KeyframeGroup+Extensions.swift +4 -4
- package/Sources/Private/Utility/Primitives/ColorExtension.swift +7 -7
- package/Sources/Private/Utility/Primitives/VectorsExtensions.swift +29 -21
- package/Sources/{Private/Model/Animation.swift → Public/Animation/LottieAnimation.swift} +13 -5
- package/Sources/Public/Animation/{AnimationPublic.swift → LottieAnimationHelpers.swift} +32 -17
- package/Sources/Public/Animation/{AnimationView.swift → LottieAnimationView.swift} +68 -19
- package/Sources/Public/Animation/{AnimationViewInitializers.swift → LottieAnimationViewInitializers.swift} +6 -6
- package/Sources/Public/AnimationCache/AnimationCacheProvider.swift +3 -3
- package/Sources/Public/AnimationCache/LRUAnimationCache.swift +3 -3
- package/Sources/Public/DynamicProperties/AnimationKeypath.swift +3 -3
- package/Sources/Public/DynamicProperties/AnyValueProvider.swift +2 -2
- package/Sources/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +10 -10
- package/Sources/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +4 -4
- package/Sources/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +5 -5
- package/Sources/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +2 -2
- package/Sources/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +2 -2
- package/Sources/Public/FontProvider/AnimationFontProvider.swift +1 -1
- package/Sources/Public/ImageProvider/AnimationImageProvider.swift +2 -2
- package/Sources/Public/Keyframes/Interpolatable.swift +17 -17
- package/Sources/Public/Keyframes/Keyframe.swift +10 -10
- package/Sources/Public/LottieConfiguration.swift +1 -1
- package/Sources/Public/Primitives/{Color.swift → LottieColor.swift} +10 -2
- package/Sources/Public/Primitives/Vectors.swift +18 -2
- package/Sources/Public/TextProvider/AnimationTextProvider.swift +1 -1
- package/Sources/Public/iOS/AnimatedButton.swift +26 -24
- package/Sources/Public/iOS/AnimatedControl.swift +6 -6
- package/Sources/Public/iOS/AnimatedSwitch.swift +16 -11
- package/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +23 -8
- package/Sources/Public/iOS/{AnimationViewBase.swift → LottieAnimationViewBase.swift} +4 -4
- package/Sources/Public/iOS/UIColorExtension.swift +2 -2
- package/Sources/Public/macOS/{AnimationViewBase.macOS.swift → LottieAnimationViewBase.macOS.swift} +4 -4
- package/Tests/AnimationKeypathTests.swift +1 -1
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~22UHuHHSTYh5NFeueXXSDdev_8VAbw8H8yl2ICssaC0vaCLj2G2CGZCjUMEyki9c-k-CecFJRyspvzJLiQTjUw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~4VqMqsI5lOfxRppnud6-VDWcNsU8J7VgFCJfW2dXPwOcAkvU-I8Um5yp9n0Zv6nr3VmcxYggaVMDFfR0U_vjKw== +1 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~6DmZhylL-XQx-O08NugyWINI0ugrLVgVOpbrdp0sT2tEqw-jVD2vvBWYRnYHALkM2_qP2yy-VoovSMzfYALY8A== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~9dj3E5foFK2l_1CEpoRxToU1N6jCdhRVc5vhR10fHS938L9w8HxbiVCPGxYy5981O6M1yZsD4tHFbqBMbER4bQ== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~Bys36bGK_YkCjRNoPMkq3R0OcyPNrVNka1Gz45ilbXJTqp9xAJexx6qKBh86_fm7OgBCO0WS2gJBy77DUUnOOA== +1 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~QJMKb50ZfaWLSHxBSGPlrzULLCqTlb_6W-X0N1-e5PfwCKjpYKOElImsOwgZKVK0cdyf-6u4Zp3mm3BfGQVQ9Q== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~YyEdK1WNFTPo-R3Og2OWduKSikuFYneXurEZbyNLZeDmJLJkd7Ew8jNxy4mvgZw4f4Sikp4swEjJgVzXqhev5g== +1 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~bZd73QR3pWGndrn46_NXJw2dUT7WdBjkH5fdPZ7EnzlcZ9Ifv6WR14RKeWI9diiEjcRJE7ZOWqZ9fzf2vvTnLw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~baCaLsz8Sq-r6sHhJcZeowVdrnrIxKwDps5Q1Aq38G2AQ3HaopZ9m3A8IXtTFSiZGNiO2qnM9yH7iJfuzC5K0A== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~iZXYCVJLYHKtR7eFHwefLiejC9CkRbBBSkkZmwfkiDEIdUKE4GgVkdDrcHry91RF7d9y7AuYovfGVp1-fuNg0g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~pTTJImrF4EktmVXGCigWBn7v6YlbH5eFCXIW35CW-iyypvzFMXXYYbQO1ly6Bf3u6CdaepZko-L9obC1mjigMA== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~sVXLeN9UCp6IsOPeuoY76nF-bP-w2rBm61UYvs5XE3o5XhbM7itN2s1XD5i9COIaVMytmUFB-mvCLCqHfHWwpw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~t8Vsjx3tjPBGQIElMCvqzxLS0hDmBGuLa_CEiB64N2Vxp3qoUfNF0Sar84QnEDOKfyVF6c1KTn1QYg7fRJrk8g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~zUmPx8nRHLa8-g1WWSYYzveS_6qmBf-y4xyS-dHzD7c_xWwPZlsfKg8UngImNdn0gxGOBSRmCeXbYwWpLfj_Rg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~22UHuHHSTYh5NFeueXXSDdev_8VAbw8H8yl2ICssaC0vaCLj2G2CGZCjUMEyki9c-k-CecFJRyspvzJLiQTjUw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~4VqMqsI5lOfxRppnud6-VDWcNsU8J7VgFCJfW2dXPwOcAkvU-I8Um5yp9n0Zv6nr3VmcxYggaVMDFfR0U_vjKw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~6DmZhylL-XQx-O08NugyWINI0ugrLVgVOpbrdp0sT2tEqw-jVD2vvBWYRnYHALkM2_qP2yy-VoovSMzfYALY8A== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~9dj3E5foFK2l_1CEpoRxToU1N6jCdhRVc5vhR10fHS938L9w8HxbiVCPGxYy5981O6M1yZsD4tHFbqBMbER4bQ== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~Bys36bGK_YkCjRNoPMkq3R0OcyPNrVNka1Gz45ilbXJTqp9xAJexx6qKBh86_fm7OgBCO0WS2gJBy77DUUnOOA== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~QJMKb50ZfaWLSHxBSGPlrzULLCqTlb_6W-X0N1-e5PfwCKjpYKOElImsOwgZKVK0cdyf-6u4Zp3mm3BfGQVQ9Q== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~YyEdK1WNFTPo-R3Og2OWduKSikuFYneXurEZbyNLZeDmJLJkd7Ew8jNxy4mvgZw4f4Sikp4swEjJgVzXqhev5g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~bZd73QR3pWGndrn46_NXJw2dUT7WdBjkH5fdPZ7EnzlcZ9Ifv6WR14RKeWI9diiEjcRJE7ZOWqZ9fzf2vvTnLw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~baCaLsz8Sq-r6sHhJcZeowVdrnrIxKwDps5Q1Aq38G2AQ3HaopZ9m3A8IXtTFSiZGNiO2qnM9yH7iJfuzC5K0A== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~iZXYCVJLYHKtR7eFHwefLiejC9CkRbBBSkkZmwfkiDEIdUKE4GgVkdDrcHry91RF7d9y7AuYovfGVp1-fuNg0g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~pTTJImrF4EktmVXGCigWBn7v6YlbH5eFCXIW35CW-iyypvzFMXXYYbQO1ly6Bf3u6CdaepZko-L9obC1mjigMA== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~sVXLeN9UCp6IsOPeuoY76nF-bP-w2rBm61UYvs5XE3o5XhbM7itN2s1XD5i9COIaVMytmUFB-mvCLCqHfHWwpw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~t8Vsjx3tjPBGQIElMCvqzxLS0hDmBGuLa_CEiB64N2Vxp3qoUfNF0Sar84QnEDOKfyVF6c1KTn1QYg7fRJrk8g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~zUmPx8nRHLa8-g1WWSYYzveS_6qmBf-y4xyS-dHzD7c_xWwPZlsfKg8UngImNdn0gxGOBSRmCeXbYwWpLfj_Rg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Info.plist +29 -0
- package/Tests/ParsingTests.swift +2 -2
- package/Tests/PerformanceTests.swift +9 -9
- package/Tests/SnapshotConfiguration.swift +4 -4
- package/Tests/SnapshotTests.swift +6 -6
- package/lottie-ios.podspec +1 -1
- package/package.json +1 -1
|
@@ -33,13 +33,13 @@ final class GradientStroke: ShapeItem {
|
|
|
33
33
|
|
|
34
34
|
required init(from decoder: Decoder) throws {
|
|
35
35
|
let container = try decoder.container(keyedBy: GradientStroke.CodingKeys.self)
|
|
36
|
-
opacity = try container.decode(KeyframeGroup<
|
|
37
|
-
startPoint = try container.decode(KeyframeGroup<
|
|
38
|
-
endPoint = try container.decode(KeyframeGroup<
|
|
36
|
+
opacity = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
37
|
+
startPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .startPoint)
|
|
38
|
+
endPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .endPoint)
|
|
39
39
|
gradientType = try container.decode(GradientType.self, forKey: .gradientType)
|
|
40
|
-
highlightLength = try container.decodeIfPresent(KeyframeGroup<
|
|
41
|
-
highlightAngle = try container.decodeIfPresent(KeyframeGroup<
|
|
42
|
-
width = try container.decode(KeyframeGroup<
|
|
40
|
+
highlightLength = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightLength)
|
|
41
|
+
highlightAngle = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightAngle)
|
|
42
|
+
width = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .width)
|
|
43
43
|
lineCap = try container.decodeIfPresent(LineCap.self, forKey: .lineCap) ?? .round
|
|
44
44
|
lineJoin = try container.decodeIfPresent(LineJoin.self, forKey: .lineJoin) ?? .round
|
|
45
45
|
miterLimit = try container.decodeIfPresent(Double.self, forKey: .miterLimit) ?? 4
|
|
@@ -53,28 +53,28 @@ final class GradientStroke: ShapeItem {
|
|
|
53
53
|
|
|
54
54
|
required init(dictionary: [String: Any]) throws {
|
|
55
55
|
let opacityDictionary: [String: Any] = try dictionary.value(for: CodingKeys.opacity)
|
|
56
|
-
opacity = try KeyframeGroup<
|
|
56
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
57
57
|
let startPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.startPoint)
|
|
58
|
-
startPoint = try KeyframeGroup<
|
|
58
|
+
startPoint = try KeyframeGroup<LottieVector3D>(dictionary: startPointDictionary)
|
|
59
59
|
let endPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.endPoint)
|
|
60
|
-
endPoint = try KeyframeGroup<
|
|
60
|
+
endPoint = try KeyframeGroup<LottieVector3D>(dictionary: endPointDictionary)
|
|
61
61
|
let gradientRawType: Int = try dictionary.value(for: CodingKeys.gradientType)
|
|
62
62
|
guard let gradient = GradientType(rawValue: gradientRawType) else {
|
|
63
63
|
throw InitializableError.invalidInput
|
|
64
64
|
}
|
|
65
65
|
gradientType = gradient
|
|
66
66
|
if let highlightLengthDictionary = dictionary[CodingKeys.highlightLength.rawValue] as? [String: Any] {
|
|
67
|
-
highlightLength = try? KeyframeGroup<
|
|
67
|
+
highlightLength = try? KeyframeGroup<LottieVector1D>(dictionary: highlightLengthDictionary)
|
|
68
68
|
} else {
|
|
69
69
|
highlightLength = nil
|
|
70
70
|
}
|
|
71
71
|
if let highlightAngleDictionary = dictionary[CodingKeys.highlightAngle.rawValue] as? [String: Any] {
|
|
72
|
-
highlightAngle = try? KeyframeGroup<
|
|
72
|
+
highlightAngle = try? KeyframeGroup<LottieVector1D>(dictionary: highlightAngleDictionary)
|
|
73
73
|
} else {
|
|
74
74
|
highlightAngle = nil
|
|
75
75
|
}
|
|
76
76
|
let widthDictionary: [String: Any] = try dictionary.value(for: CodingKeys.width)
|
|
77
|
-
width = try KeyframeGroup<
|
|
77
|
+
width = try KeyframeGroup<LottieVector1D>(dictionary: widthDictionary)
|
|
78
78
|
if
|
|
79
79
|
let lineCapRawValue = dictionary[CodingKeys.lineCap.rawValue] as? Int,
|
|
80
80
|
let lineCap = LineCap(rawValue: lineCapRawValue)
|
|
@@ -104,22 +104,22 @@ final class GradientStroke: ShapeItem {
|
|
|
104
104
|
// MARK: Internal
|
|
105
105
|
|
|
106
106
|
/// The opacity of the fill
|
|
107
|
-
let opacity: KeyframeGroup<
|
|
107
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
108
108
|
|
|
109
109
|
/// The start of the gradient
|
|
110
|
-
let startPoint: KeyframeGroup<
|
|
110
|
+
let startPoint: KeyframeGroup<LottieVector3D>
|
|
111
111
|
|
|
112
112
|
/// The end of the gradient
|
|
113
|
-
let endPoint: KeyframeGroup<
|
|
113
|
+
let endPoint: KeyframeGroup<LottieVector3D>
|
|
114
114
|
|
|
115
115
|
/// The type of gradient
|
|
116
116
|
let gradientType: GradientType
|
|
117
117
|
|
|
118
118
|
/// Gradient Highlight Length. Only if type is Radial
|
|
119
|
-
let highlightLength: KeyframeGroup<
|
|
119
|
+
let highlightLength: KeyframeGroup<LottieVector1D>?
|
|
120
120
|
|
|
121
121
|
/// Highlight Angle. Only if type is Radial
|
|
122
|
-
let highlightAngle: KeyframeGroup<
|
|
122
|
+
let highlightAngle: KeyframeGroup<LottieVector1D>?
|
|
123
123
|
|
|
124
124
|
/// The number of color points in the gradient
|
|
125
125
|
let numberOfColors: Int
|
|
@@ -128,7 +128,7 @@ final class GradientStroke: ShapeItem {
|
|
|
128
128
|
let colors: KeyframeGroup<[Double]>
|
|
129
129
|
|
|
130
130
|
/// The width of the stroke
|
|
131
|
-
let width: KeyframeGroup<
|
|
131
|
+
let width: KeyframeGroup<LottieVector1D>
|
|
132
132
|
|
|
133
133
|
/// Line Cap
|
|
134
134
|
let lineCap: LineCap
|
|
@@ -14,9 +14,9 @@ final class Rectangle: ShapeItem {
|
|
|
14
14
|
required init(from decoder: Decoder) throws {
|
|
15
15
|
let container = try decoder.container(keyedBy: Rectangle.CodingKeys.self)
|
|
16
16
|
direction = try container.decodeIfPresent(PathDirection.self, forKey: .direction) ?? .clockwise
|
|
17
|
-
position = try container.decode(KeyframeGroup<
|
|
18
|
-
size = try container.decode(KeyframeGroup<
|
|
19
|
-
cornerRadius = try container.decode(KeyframeGroup<
|
|
17
|
+
position = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
18
|
+
size = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .size)
|
|
19
|
+
cornerRadius = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .cornerRadius)
|
|
20
20
|
try super.init(from: decoder)
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -30,11 +30,11 @@ final class Rectangle: ShapeItem {
|
|
|
30
30
|
direction = .clockwise
|
|
31
31
|
}
|
|
32
32
|
let positionDictionary: [String: Any] = try dictionary.value(for: CodingKeys.position)
|
|
33
|
-
position = try KeyframeGroup<
|
|
33
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
34
34
|
let sizeDictionary: [String: Any] = try dictionary.value(for: CodingKeys.size)
|
|
35
|
-
size = try KeyframeGroup<
|
|
35
|
+
size = try KeyframeGroup<LottieVector3D>(dictionary: sizeDictionary)
|
|
36
36
|
let cornerRadiusDictionary: [String: Any] = try dictionary.value(for: CodingKeys.cornerRadius)
|
|
37
|
-
cornerRadius = try KeyframeGroup<
|
|
37
|
+
cornerRadius = try KeyframeGroup<LottieVector1D>(dictionary: cornerRadiusDictionary)
|
|
38
38
|
try super.init(dictionary: dictionary)
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -44,13 +44,13 @@ final class Rectangle: ShapeItem {
|
|
|
44
44
|
let direction: PathDirection
|
|
45
45
|
|
|
46
46
|
/// The position
|
|
47
|
-
let position: KeyframeGroup<
|
|
47
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
48
48
|
|
|
49
49
|
/// The size
|
|
50
|
-
let size: KeyframeGroup<
|
|
50
|
+
let size: KeyframeGroup<LottieVector3D>
|
|
51
51
|
|
|
52
52
|
/// The Corner radius of the rectangle
|
|
53
|
-
let cornerRadius: KeyframeGroup<
|
|
53
|
+
let cornerRadius: KeyframeGroup<LottieVector1D>
|
|
54
54
|
|
|
55
55
|
override func encode(to encoder: Encoder) throws {
|
|
56
56
|
try super.encode(to: encoder)
|
|
@@ -13,65 +13,70 @@ final class Repeater: ShapeItem {
|
|
|
13
13
|
|
|
14
14
|
required init(from decoder: Decoder) throws {
|
|
15
15
|
let container = try decoder.container(keyedBy: Repeater.CodingKeys.self)
|
|
16
|
-
copies = try container
|
|
17
|
-
|
|
16
|
+
copies = try container
|
|
17
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .copies) ?? KeyframeGroup(LottieVector1D(0))
|
|
18
|
+
offset = try container
|
|
19
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .offset) ?? KeyframeGroup(LottieVector1D(0))
|
|
18
20
|
let transformContainer = try container.nestedContainer(keyedBy: TransformKeys.self, forKey: .transform)
|
|
19
21
|
startOpacity = try transformContainer
|
|
20
|
-
.decodeIfPresent(KeyframeGroup<
|
|
22
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .startOpacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
21
23
|
endOpacity = try transformContainer
|
|
22
|
-
.decodeIfPresent(KeyframeGroup<
|
|
24
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .endOpacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
23
25
|
rotation = try transformContainer
|
|
24
|
-
.decodeIfPresent(KeyframeGroup<
|
|
26
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation) ?? KeyframeGroup(LottieVector1D(0))
|
|
25
27
|
position = try transformContainer
|
|
26
|
-
.decodeIfPresent(KeyframeGroup<
|
|
28
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position) ??
|
|
29
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
27
30
|
anchorPoint = try transformContainer
|
|
28
|
-
.decodeIfPresent(KeyframeGroup<
|
|
31
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchorPoint) ??
|
|
32
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
29
33
|
scale = try transformContainer
|
|
30
|
-
.decodeIfPresent(KeyframeGroup<
|
|
34
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale) ??
|
|
35
|
+
KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
31
36
|
try super.init(from: decoder)
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
required init(dictionary: [String: Any]) throws {
|
|
35
40
|
if let copiesDictionary = dictionary[CodingKeys.copies.rawValue] as? [String: Any] {
|
|
36
|
-
copies = try KeyframeGroup<
|
|
41
|
+
copies = try KeyframeGroup<LottieVector1D>(dictionary: copiesDictionary)
|
|
37
42
|
} else {
|
|
38
|
-
copies = KeyframeGroup(
|
|
43
|
+
copies = KeyframeGroup(LottieVector1D(0))
|
|
39
44
|
}
|
|
40
45
|
if let offsetDictionary = dictionary[CodingKeys.offset.rawValue] as? [String: Any] {
|
|
41
|
-
offset = try KeyframeGroup<
|
|
46
|
+
offset = try KeyframeGroup<LottieVector1D>(dictionary: offsetDictionary)
|
|
42
47
|
} else {
|
|
43
|
-
offset = KeyframeGroup(
|
|
48
|
+
offset = KeyframeGroup(LottieVector1D(0))
|
|
44
49
|
}
|
|
45
50
|
let transformDictionary: [String: Any] = try dictionary.value(for: CodingKeys.transform)
|
|
46
51
|
if let startOpacityDictionary = transformDictionary[TransformKeys.startOpacity.rawValue] as? [String: Any] {
|
|
47
|
-
startOpacity = try KeyframeGroup<
|
|
52
|
+
startOpacity = try KeyframeGroup<LottieVector1D>(dictionary: startOpacityDictionary)
|
|
48
53
|
} else {
|
|
49
|
-
startOpacity = KeyframeGroup(
|
|
54
|
+
startOpacity = KeyframeGroup(LottieVector1D(100))
|
|
50
55
|
}
|
|
51
56
|
if let endOpacityDictionary = transformDictionary[TransformKeys.endOpacity.rawValue] as? [String: Any] {
|
|
52
|
-
endOpacity = try KeyframeGroup<
|
|
57
|
+
endOpacity = try KeyframeGroup<LottieVector1D>(dictionary: endOpacityDictionary)
|
|
53
58
|
} else {
|
|
54
|
-
endOpacity = KeyframeGroup(
|
|
59
|
+
endOpacity = KeyframeGroup(LottieVector1D(100))
|
|
55
60
|
}
|
|
56
61
|
if let rotationDictionary = transformDictionary[TransformKeys.rotation.rawValue] as? [String: Any] {
|
|
57
|
-
rotation = try KeyframeGroup<
|
|
62
|
+
rotation = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
58
63
|
} else {
|
|
59
|
-
rotation = KeyframeGroup(
|
|
64
|
+
rotation = KeyframeGroup(LottieVector1D(0))
|
|
60
65
|
}
|
|
61
66
|
if let positionDictionary = transformDictionary[TransformKeys.position.rawValue] as? [String: Any] {
|
|
62
|
-
position = try KeyframeGroup<
|
|
67
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
63
68
|
} else {
|
|
64
|
-
position = KeyframeGroup(
|
|
69
|
+
position = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
65
70
|
}
|
|
66
71
|
if let anchorPointDictionary = transformDictionary[TransformKeys.anchorPoint.rawValue] as? [String: Any] {
|
|
67
|
-
anchorPoint = try KeyframeGroup<
|
|
72
|
+
anchorPoint = try KeyframeGroup<LottieVector3D>(dictionary: anchorPointDictionary)
|
|
68
73
|
} else {
|
|
69
|
-
anchorPoint = KeyframeGroup(
|
|
74
|
+
anchorPoint = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
70
75
|
}
|
|
71
76
|
if let scaleDictionary = transformDictionary[TransformKeys.scale.rawValue] as? [String: Any] {
|
|
72
|
-
scale = try KeyframeGroup<
|
|
77
|
+
scale = try KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
73
78
|
} else {
|
|
74
|
-
scale = KeyframeGroup(
|
|
79
|
+
scale = KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
75
80
|
}
|
|
76
81
|
try super.init(dictionary: dictionary)
|
|
77
82
|
}
|
|
@@ -79,28 +84,28 @@ final class Repeater: ShapeItem {
|
|
|
79
84
|
// MARK: Internal
|
|
80
85
|
|
|
81
86
|
/// The number of copies to repeat
|
|
82
|
-
let copies: KeyframeGroup<
|
|
87
|
+
let copies: KeyframeGroup<LottieVector1D>
|
|
83
88
|
|
|
84
89
|
/// The offset of each copy
|
|
85
|
-
let offset: KeyframeGroup<
|
|
90
|
+
let offset: KeyframeGroup<LottieVector1D>
|
|
86
91
|
|
|
87
92
|
/// Start Opacity
|
|
88
|
-
let startOpacity: KeyframeGroup<
|
|
93
|
+
let startOpacity: KeyframeGroup<LottieVector1D>
|
|
89
94
|
|
|
90
95
|
/// End opacity
|
|
91
|
-
let endOpacity: KeyframeGroup<
|
|
96
|
+
let endOpacity: KeyframeGroup<LottieVector1D>
|
|
92
97
|
|
|
93
98
|
/// The rotation
|
|
94
|
-
let rotation: KeyframeGroup<
|
|
99
|
+
let rotation: KeyframeGroup<LottieVector1D>
|
|
95
100
|
|
|
96
101
|
/// Anchor Point
|
|
97
|
-
let anchorPoint: KeyframeGroup<
|
|
102
|
+
let anchorPoint: KeyframeGroup<LottieVector3D>
|
|
98
103
|
|
|
99
104
|
/// Position
|
|
100
|
-
let position: KeyframeGroup<
|
|
105
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
101
106
|
|
|
102
107
|
/// Scale
|
|
103
|
-
let scale: KeyframeGroup<
|
|
108
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
104
109
|
|
|
105
110
|
override func encode(to encoder: Encoder) throws {
|
|
106
111
|
try super.encode(to: encoder)
|
|
@@ -14,74 +14,80 @@ final class ShapeTransform: ShapeItem {
|
|
|
14
14
|
required init(from decoder: Decoder) throws {
|
|
15
15
|
let container = try decoder.container(keyedBy: ShapeTransform.CodingKeys.self)
|
|
16
16
|
anchor = try container
|
|
17
|
-
.decodeIfPresent(KeyframeGroup<
|
|
17
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchor) ??
|
|
18
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
18
19
|
position = try container
|
|
19
|
-
.decodeIfPresent(KeyframeGroup<
|
|
20
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position) ??
|
|
21
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
20
22
|
scale = try container
|
|
21
|
-
.decodeIfPresent(KeyframeGroup<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale) ??
|
|
24
|
+
KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
25
|
+
rotation = try container
|
|
26
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation) ?? KeyframeGroup(LottieVector1D(0))
|
|
27
|
+
opacity = try container
|
|
28
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
29
|
+
skew = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skew) ?? KeyframeGroup(LottieVector1D(0))
|
|
30
|
+
skewAxis = try container
|
|
31
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skewAxis) ?? KeyframeGroup(LottieVector1D(0))
|
|
26
32
|
try super.init(from: decoder)
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
required init(dictionary: [String: Any]) throws {
|
|
30
36
|
if
|
|
31
37
|
let anchorDictionary = dictionary[CodingKeys.anchor.rawValue] as? [String: Any],
|
|
32
|
-
let anchor = try? KeyframeGroup<
|
|
38
|
+
let anchor = try? KeyframeGroup<LottieVector3D>(dictionary: anchorDictionary)
|
|
33
39
|
{
|
|
34
40
|
self.anchor = anchor
|
|
35
41
|
} else {
|
|
36
|
-
anchor = KeyframeGroup(
|
|
42
|
+
anchor = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
37
43
|
}
|
|
38
44
|
if
|
|
39
45
|
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
|
|
40
|
-
let position = try? KeyframeGroup<
|
|
46
|
+
let position = try? KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
41
47
|
{
|
|
42
48
|
self.position = position
|
|
43
49
|
} else {
|
|
44
|
-
position = KeyframeGroup(
|
|
50
|
+
position = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
45
51
|
}
|
|
46
52
|
if
|
|
47
53
|
let scaleDictionary = dictionary[CodingKeys.scale.rawValue] as? [String: Any],
|
|
48
|
-
let scale = try? KeyframeGroup<
|
|
54
|
+
let scale = try? KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
49
55
|
{
|
|
50
56
|
self.scale = scale
|
|
51
57
|
} else {
|
|
52
|
-
scale = KeyframeGroup(
|
|
58
|
+
scale = KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
53
59
|
}
|
|
54
60
|
if
|
|
55
61
|
let rotationDictionary = dictionary[CodingKeys.rotation.rawValue] as? [String: Any],
|
|
56
|
-
let rotation = try? KeyframeGroup<
|
|
62
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
57
63
|
{
|
|
58
64
|
self.rotation = rotation
|
|
59
65
|
} else {
|
|
60
|
-
rotation = KeyframeGroup(
|
|
66
|
+
rotation = KeyframeGroup(LottieVector1D(0))
|
|
61
67
|
}
|
|
62
68
|
if
|
|
63
69
|
let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any],
|
|
64
|
-
let opacity = try? KeyframeGroup<
|
|
70
|
+
let opacity = try? KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
65
71
|
{
|
|
66
72
|
self.opacity = opacity
|
|
67
73
|
} else {
|
|
68
|
-
opacity = KeyframeGroup(
|
|
74
|
+
opacity = KeyframeGroup(LottieVector1D(100))
|
|
69
75
|
}
|
|
70
76
|
if
|
|
71
77
|
let skewDictionary = dictionary[CodingKeys.skew.rawValue] as? [String: Any],
|
|
72
|
-
let skew = try? KeyframeGroup<
|
|
78
|
+
let skew = try? KeyframeGroup<LottieVector1D>(dictionary: skewDictionary)
|
|
73
79
|
{
|
|
74
80
|
self.skew = skew
|
|
75
81
|
} else {
|
|
76
|
-
skew = KeyframeGroup(
|
|
82
|
+
skew = KeyframeGroup(LottieVector1D(0))
|
|
77
83
|
}
|
|
78
84
|
if
|
|
79
85
|
let skewAxisDictionary = dictionary[CodingKeys.skewAxis.rawValue] as? [String: Any],
|
|
80
|
-
let skewAxis = try? KeyframeGroup<
|
|
86
|
+
let skewAxis = try? KeyframeGroup<LottieVector1D>(dictionary: skewAxisDictionary)
|
|
81
87
|
{
|
|
82
88
|
self.skewAxis = skewAxis
|
|
83
89
|
} else {
|
|
84
|
-
skewAxis = KeyframeGroup(
|
|
90
|
+
skewAxis = KeyframeGroup(LottieVector1D(0))
|
|
85
91
|
}
|
|
86
92
|
try super.init(dictionary: dictionary)
|
|
87
93
|
}
|
|
@@ -89,25 +95,25 @@ final class ShapeTransform: ShapeItem {
|
|
|
89
95
|
// MARK: Internal
|
|
90
96
|
|
|
91
97
|
/// Anchor Point
|
|
92
|
-
let anchor: KeyframeGroup<
|
|
98
|
+
let anchor: KeyframeGroup<LottieVector3D>
|
|
93
99
|
|
|
94
100
|
/// Position
|
|
95
|
-
let position: KeyframeGroup<
|
|
101
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
96
102
|
|
|
97
103
|
/// Scale
|
|
98
|
-
let scale: KeyframeGroup<
|
|
104
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
99
105
|
|
|
100
106
|
/// Rotation
|
|
101
|
-
let rotation: KeyframeGroup<
|
|
107
|
+
let rotation: KeyframeGroup<LottieVector1D>
|
|
102
108
|
|
|
103
109
|
/// opacity
|
|
104
|
-
let opacity: KeyframeGroup<
|
|
110
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
105
111
|
|
|
106
112
|
/// Skew
|
|
107
|
-
let skew: KeyframeGroup<
|
|
113
|
+
let skew: KeyframeGroup<LottieVector1D>
|
|
108
114
|
|
|
109
115
|
/// Skew Axis
|
|
110
|
-
let skewAxis: KeyframeGroup<
|
|
116
|
+
let skewAxis: KeyframeGroup<LottieVector1D>
|
|
111
117
|
|
|
112
118
|
override func encode(to encoder: Encoder) throws {
|
|
113
119
|
try super.encode(to: encoder)
|
|
@@ -24,13 +24,13 @@ final class Star: ShapeItem {
|
|
|
24
24
|
required init(from decoder: Decoder) throws {
|
|
25
25
|
let container = try decoder.container(keyedBy: Star.CodingKeys.self)
|
|
26
26
|
direction = try container.decodeIfPresent(PathDirection.self, forKey: .direction) ?? .clockwise
|
|
27
|
-
position = try container.decode(KeyframeGroup<
|
|
28
|
-
outerRadius = try container.decode(KeyframeGroup<
|
|
29
|
-
outerRoundness = try container.decode(KeyframeGroup<
|
|
30
|
-
innerRadius = try container.decodeIfPresent(KeyframeGroup<
|
|
31
|
-
innerRoundness = try container.decodeIfPresent(KeyframeGroup<
|
|
32
|
-
rotation = try container.decode(KeyframeGroup<
|
|
33
|
-
points = try container.decode(KeyframeGroup<
|
|
27
|
+
position = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
28
|
+
outerRadius = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .outerRadius)
|
|
29
|
+
outerRoundness = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .outerRoundness)
|
|
30
|
+
innerRadius = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .innerRadius)
|
|
31
|
+
innerRoundness = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .innerRoundness)
|
|
32
|
+
rotation = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .rotation)
|
|
33
|
+
points = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .points)
|
|
34
34
|
starType = try container.decode(StarType.self, forKey: .starType)
|
|
35
35
|
try super.init(from: decoder)
|
|
36
36
|
}
|
|
@@ -45,25 +45,25 @@ final class Star: ShapeItem {
|
|
|
45
45
|
direction = .clockwise
|
|
46
46
|
}
|
|
47
47
|
let positionDictionary: [String: Any] = try dictionary.value(for: CodingKeys.position)
|
|
48
|
-
position = try KeyframeGroup<
|
|
48
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
49
49
|
let outerRadiusDictionary: [String: Any] = try dictionary.value(for: CodingKeys.outerRadius)
|
|
50
|
-
outerRadius = try KeyframeGroup<
|
|
50
|
+
outerRadius = try KeyframeGroup<LottieVector1D>(dictionary: outerRadiusDictionary)
|
|
51
51
|
let outerRoundnessDictionary: [String: Any] = try dictionary.value(for: CodingKeys.outerRoundness)
|
|
52
|
-
outerRoundness = try KeyframeGroup<
|
|
52
|
+
outerRoundness = try KeyframeGroup<LottieVector1D>(dictionary: outerRoundnessDictionary)
|
|
53
53
|
if let innerRadiusDictionary = dictionary[CodingKeys.innerRadius.rawValue] as? [String: Any] {
|
|
54
|
-
innerRadius = try KeyframeGroup<
|
|
54
|
+
innerRadius = try KeyframeGroup<LottieVector1D>(dictionary: innerRadiusDictionary)
|
|
55
55
|
} else {
|
|
56
56
|
innerRadius = nil
|
|
57
57
|
}
|
|
58
58
|
if let innerRoundnessDictionary = dictionary[CodingKeys.innerRoundness.rawValue] as? [String: Any] {
|
|
59
|
-
innerRoundness = try KeyframeGroup<
|
|
59
|
+
innerRoundness = try KeyframeGroup<LottieVector1D>(dictionary: innerRoundnessDictionary)
|
|
60
60
|
} else {
|
|
61
61
|
innerRoundness = nil
|
|
62
62
|
}
|
|
63
63
|
let rotationDictionary: [String: Any] = try dictionary.value(for: CodingKeys.rotation)
|
|
64
|
-
rotation = try KeyframeGroup<
|
|
64
|
+
rotation = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
65
65
|
let pointsDictionary: [String: Any] = try dictionary.value(for: CodingKeys.points)
|
|
66
|
-
points = try KeyframeGroup<
|
|
66
|
+
points = try KeyframeGroup<LottieVector1D>(dictionary: pointsDictionary)
|
|
67
67
|
let starTypeRawValue: Int = try dictionary.value(for: CodingKeys.starType)
|
|
68
68
|
guard let starType = StarType(rawValue: starTypeRawValue) else {
|
|
69
69
|
throw InitializableError.invalidInput
|
|
@@ -78,25 +78,25 @@ final class Star: ShapeItem {
|
|
|
78
78
|
let direction: PathDirection
|
|
79
79
|
|
|
80
80
|
/// The position of the star
|
|
81
|
-
let position: KeyframeGroup<
|
|
81
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
82
82
|
|
|
83
83
|
/// The outer radius of the star
|
|
84
|
-
let outerRadius: KeyframeGroup<
|
|
84
|
+
let outerRadius: KeyframeGroup<LottieVector1D>
|
|
85
85
|
|
|
86
86
|
/// The outer roundness of the star
|
|
87
|
-
let outerRoundness: KeyframeGroup<
|
|
87
|
+
let outerRoundness: KeyframeGroup<LottieVector1D>
|
|
88
88
|
|
|
89
89
|
/// The outer radius of the star
|
|
90
|
-
let innerRadius: KeyframeGroup<
|
|
90
|
+
let innerRadius: KeyframeGroup<LottieVector1D>?
|
|
91
91
|
|
|
92
92
|
/// The outer roundness of the star
|
|
93
|
-
let innerRoundness: KeyframeGroup<
|
|
93
|
+
let innerRoundness: KeyframeGroup<LottieVector1D>?
|
|
94
94
|
|
|
95
95
|
/// The rotation of the star
|
|
96
|
-
let rotation: KeyframeGroup<
|
|
96
|
+
let rotation: KeyframeGroup<LottieVector1D>
|
|
97
97
|
|
|
98
98
|
/// The number of points on the star
|
|
99
|
-
let points: KeyframeGroup<
|
|
99
|
+
let points: KeyframeGroup<LottieVector1D>
|
|
100
100
|
|
|
101
101
|
/// The type of star
|
|
102
102
|
let starType: StarType
|
|
@@ -13,9 +13,9 @@ final class Stroke: ShapeItem {
|
|
|
13
13
|
|
|
14
14
|
required init(from decoder: Decoder) throws {
|
|
15
15
|
let container = try decoder.container(keyedBy: Stroke.CodingKeys.self)
|
|
16
|
-
opacity = try container.decode(KeyframeGroup<
|
|
17
|
-
color = try container.decode(KeyframeGroup<
|
|
18
|
-
width = try container.decode(KeyframeGroup<
|
|
16
|
+
opacity = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
17
|
+
color = try container.decode(KeyframeGroup<LottieColor>.self, forKey: .color)
|
|
18
|
+
width = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .width)
|
|
19
19
|
lineCap = try container.decodeIfPresent(LineCap.self, forKey: .lineCap) ?? .round
|
|
20
20
|
lineJoin = try container.decodeIfPresent(LineJoin.self, forKey: .lineJoin) ?? .round
|
|
21
21
|
miterLimit = try container.decodeIfPresent(Double.self, forKey: .miterLimit) ?? 4
|
|
@@ -25,11 +25,11 @@ final class Stroke: ShapeItem {
|
|
|
25
25
|
|
|
26
26
|
required init(dictionary: [String: Any]) throws {
|
|
27
27
|
let opacityDictionary: [String: Any] = try dictionary.value(for: CodingKeys.opacity)
|
|
28
|
-
opacity = try KeyframeGroup<
|
|
28
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
29
29
|
let colorDictionary: [String: Any] = try dictionary.value(for: CodingKeys.color)
|
|
30
|
-
color = try KeyframeGroup<
|
|
30
|
+
color = try KeyframeGroup<LottieColor>(dictionary: colorDictionary)
|
|
31
31
|
let widthDictionary: [String: Any] = try dictionary.value(for: CodingKeys.width)
|
|
32
|
-
width = try KeyframeGroup<
|
|
32
|
+
width = try KeyframeGroup<LottieVector1D>(dictionary: widthDictionary)
|
|
33
33
|
if
|
|
34
34
|
let lineCapRawValue = dictionary[CodingKeys.lineCap.rawValue] as? Int,
|
|
35
35
|
let lineCap = LineCap(rawValue: lineCapRawValue)
|
|
@@ -55,13 +55,13 @@ final class Stroke: ShapeItem {
|
|
|
55
55
|
// MARK: Internal
|
|
56
56
|
|
|
57
57
|
/// The opacity of the stroke
|
|
58
|
-
let opacity: KeyframeGroup<
|
|
58
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
59
59
|
|
|
60
60
|
/// The Color of the stroke
|
|
61
|
-
let color: KeyframeGroup<
|
|
61
|
+
let color: KeyframeGroup<LottieColor>
|
|
62
62
|
|
|
63
63
|
/// The width of the stroke
|
|
64
|
-
let width: KeyframeGroup<
|
|
64
|
+
let width: KeyframeGroup<LottieVector1D>
|
|
65
65
|
|
|
66
66
|
/// Line Cap
|
|
67
67
|
let lineCap: LineCap
|
|
@@ -22,20 +22,20 @@ final class Trim: ShapeItem {
|
|
|
22
22
|
|
|
23
23
|
required init(from decoder: Decoder) throws {
|
|
24
24
|
let container = try decoder.container(keyedBy: Trim.CodingKeys.self)
|
|
25
|
-
start = try container.decode(KeyframeGroup<
|
|
26
|
-
end = try container.decode(KeyframeGroup<
|
|
27
|
-
offset = try container.decode(KeyframeGroup<
|
|
25
|
+
start = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .start)
|
|
26
|
+
end = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .end)
|
|
27
|
+
offset = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .offset)
|
|
28
28
|
trimType = try container.decode(TrimType.self, forKey: .trimType)
|
|
29
29
|
try super.init(from: decoder)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
required init(dictionary: [String: Any]) throws {
|
|
33
33
|
let startDictionary: [String: Any] = try dictionary.value(for: CodingKeys.start)
|
|
34
|
-
start = try KeyframeGroup<
|
|
34
|
+
start = try KeyframeGroup<LottieVector1D>(dictionary: startDictionary)
|
|
35
35
|
let endDictionary: [String: Any] = try dictionary.value(for: CodingKeys.end)
|
|
36
|
-
end = try KeyframeGroup<
|
|
36
|
+
end = try KeyframeGroup<LottieVector1D>(dictionary: endDictionary)
|
|
37
37
|
let offsetDictionary: [String: Any] = try dictionary.value(for: CodingKeys.offset)
|
|
38
|
-
offset = try KeyframeGroup<
|
|
38
|
+
offset = try KeyframeGroup<LottieVector1D>(dictionary: offsetDictionary)
|
|
39
39
|
let trimTypeRawValue: Int = try dictionary.value(for: CodingKeys.trimType)
|
|
40
40
|
guard let trimType = TrimType(rawValue: trimTypeRawValue) else {
|
|
41
41
|
throw InitializableError.invalidInput
|
|
@@ -47,13 +47,13 @@ final class Trim: ShapeItem {
|
|
|
47
47
|
// MARK: Internal
|
|
48
48
|
|
|
49
49
|
/// The start of the trim
|
|
50
|
-
let start: KeyframeGroup<
|
|
50
|
+
let start: KeyframeGroup<LottieVector1D>
|
|
51
51
|
|
|
52
52
|
/// The end of the trim
|
|
53
|
-
let end: KeyframeGroup<
|
|
53
|
+
let end: KeyframeGroup<LottieVector1D>
|
|
54
54
|
|
|
55
55
|
/// The offset of the trim
|
|
56
|
-
let offset: KeyframeGroup<
|
|
56
|
+
let offset: KeyframeGroup<LottieVector1D>
|
|
57
57
|
|
|
58
58
|
let trimType: TrimType
|
|
59
59
|
|