lottie-ios 3.4.4 → 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/Lottie.xcodeproj/project.pbxproj +56 -56
- 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/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/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/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/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} +17 -17
- package/Sources/Public/Animation/{AnimationView.swift → LottieAnimationView.swift} +27 -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 +1 -1
- package/Sources/Public/iOS/AnimatedControl.swift +6 -6
- package/Sources/Public/iOS/AnimatedSwitch.swift +1 -1
- package/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +8 -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~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~MBDeCFoahVzzmtSQrVhhy9VMJV6CmcnUkFya_qwe0XsMFscmY2nS8dxrTEYkY16sH68sEH7WVCCzTuW1z1Hocw== → data.0~Bys36bGK_YkCjRNoPMkq3R0OcyPNrVNka1Gz45ilbXJTqp9xAJexx6qKBh86_fm7OgBCO0WS2gJBy77DUUnOOA==} +0 -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~7IO4FqH8-VUsSfuA0_wMGUgfGdV7MwzpkzjwWbiB50jXZKQRHtU4G0A7ZXTvsR4mDdrWiawpNC_eriOALfZ7Og== → refs.0~6DmZhylL-XQx-O08NugyWINI0ugrLVgVOpbrdp0sT2tEqw-jVD2vvBWYRnYHALkM2_qP2yy-VoovSMzfYALY8A==} +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/{refs.0~ClRW5-6rvrgZHHbrPS1VEREaxelpVcKlERPzSa3f2rtFNXdoqATxFCsPge3a_nO4mhhtpmTmbYvyfI-obAu8Qg== → 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~UsLY5O-vDMEHEe3bF8XJvkKkYxdsKlIytgJW7zgNuetw53fG3SssfZiiMfbuYnOtvvvYBXTwpbz07V6Czp029Q== → 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~cpg4cb7H0TaehHy4a-xINJMFfBM2_AEHal_0tIX8ymNVJPsjlCysi3-Cad0Ca_SvuGwVM7ONF55OBUuC9YKZvA== → refs.0~bZd73QR3pWGndrn46_NXJw2dUT7WdBjkH5fdPZ7EnzlcZ9Ifv6WR14RKeWI9diiEjcRJE7ZOWqZ9fzf2vvTnLw==} +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/{refs.0~jdIx7vWS6ej1cqYcbCS4KyZErSMF13ELR95YwClVc98tIXcsglh7KuGvI1gIxEPDtPXQpfC3XijIAGn1quL8Dw== → 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~lz3e0YeBa8TvMBSSymToh--gc6zznUIdH2jO0AJ4so5OPNdw6wpYmJebhaENGsRoD3beUXvlyD5f7_WeZrzyNQ== → refs.0~sVXLeN9UCp6IsOPeuoY76nF-bP-w2rBm61UYvs5XE3o5XhbM7itN2s1XD5i9COIaVMytmUFB-mvCLCqHfHWwpw==} +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/{refs.0~u_5dWbliYJ__YkyUCDFjdxiFds9M8Epr_RvbU1rIRCbBQdhRJ_TUBXXcL_Qq-wVp4umNLTOzud4OpQItSpO6Rg== → refs.0~t8Vsjx3tjPBGQIElMCvqzxLS0hDmBGuLa_CEiB64N2Vxp3qoUfNF0Sar84QnEDOKfyVF6c1KTn1QYg7fRJrk8g==} +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/{refs.0~v-YGzhC2l_icsAsyp1XAbEWYwxNook-rARAWlVZINioEsgT9LGvhg2oh78nYqoeH78m1fihr5HCcGNfF7SQj0g== → refs.0~zUmPx8nRHLa8-g1WWSYYzveS_6qmBf-y4xyS-dHzD7c_xWwPZlsfKg8UngImNdn0gxGOBSRmCeXbYwWpLfj_Rg==} +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Info.plist +2 -2
- 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
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~7IO4FqH8-VUsSfuA0_wMGUgfGdV7MwzpkzjwWbiB50jXZKQRHtU4G0A7ZXTvsR4mDdrWiawpNC_eriOALfZ7Og== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~ClRW5-6rvrgZHHbrPS1VEREaxelpVcKlERPzSa3f2rtFNXdoqATxFCsPge3a_nO4mhhtpmTmbYvyfI-obAu8Qg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~Jr2dFGcJc1188nMoMha82z9wM99lCLm4MKzhjfVVjIxKeCZVGWGZH3HgJFNkTpozdk5p1u5o91dCiY4-cR1Zhg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~U4plJajEDM_uSZdglhDyj6gQO63mbeKxYP9X94aIaOtL0yErtfQnGz5SgsqQ0ToSZcJj6Ao9Wx-nesZVwBTRuw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~UsLY5O-vDMEHEe3bF8XJvkKkYxdsKlIytgJW7zgNuetw53fG3SssfZiiMfbuYnOtvvvYBXTwpbz07V6Czp029Q== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~cpg4cb7H0TaehHy4a-xINJMFfBM2_AEHal_0tIX8ymNVJPsjlCysi3-Cad0Ca_SvuGwVM7ONF55OBUuC9YKZvA== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~cuHjdTCuciVumvEpvozxwDj2wAdgWe13bzd1pUAGN45-WOgY0kIid9aUlBX675OnS-xNEc_pyQWo0RO1dKAjcw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~f_-bfn-KRHHFg39_MtwgBulEAuWH6F05yqGYydXhil6kqZ51eAoRX6tsiqOr0Oa6eL3dK1tcCBD1bWX5orCZhw== +0 -1
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~jdIx7vWS6ej1cqYcbCS4KyZErSMF13ELR95YwClVc98tIXcsglh7KuGvI1gIxEPDtPXQpfC3XijIAGn1quL8Dw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~lz3e0YeBa8TvMBSSymToh--gc6zznUIdH2jO0AJ4so5OPNdw6wpYmJebhaENGsRoD3beUXvlyD5f7_WeZrzyNQ== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~u_5dWbliYJ__YkyUCDFjdxiFds9M8Epr_RvbU1rIRCbBQdhRJ_TUBXXcL_Qq-wVp4umNLTOzud4OpQItSpO6Rg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/data.0~v-YGzhC2l_icsAsyp1XAbEWYwxNook-rARAWlVZINioEsgT9LGvhg2oh78nYqoeH78m1fihr5HCcGNfF7SQj0g== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~Jr2dFGcJc1188nMoMha82z9wM99lCLm4MKzhjfVVjIxKeCZVGWGZH3HgJFNkTpozdk5p1u5o91dCiY4-cR1Zhg== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~MBDeCFoahVzzmtSQrVhhy9VMJV6CmcnUkFya_qwe0XsMFscmY2nS8dxrTEYkY16sH68sEH7WVCCzTuW1z1Hocw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~U4plJajEDM_uSZdglhDyj6gQO63mbeKxYP9X94aIaOtL0yErtfQnGz5SgsqQ0ToSZcJj6Ao9Wx-nesZVwBTRuw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~cuHjdTCuciVumvEpvozxwDj2wAdgWe13bzd1pUAGN45-WOgY0kIid9aUlBX675OnS-xNEc_pyQWo0RO1dKAjcw== +0 -0
- package/Tests/Artifacts/LottieTests.xcresult/Data/refs.0~f_-bfn-KRHHFg39_MtwgBulEAuWH6F05yqGYydXhil6kqZ51eAoRX6tsiqOr0Oa6eL3dK1tcCBD1bWX5orCZhw== +0 -0
|
@@ -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
|
|
|
@@ -15,74 +15,74 @@ final class TextAnimator: Codable, DictionaryInitializable {
|
|
|
15
15
|
let container = try decoder.container(keyedBy: TextAnimator.CodingKeys.self)
|
|
16
16
|
name = try container.decodeIfPresent(String.self, forKey: .name) ?? ""
|
|
17
17
|
let animatorContainer = try container.nestedContainer(keyedBy: TextAnimatorKeys.self, forKey: .textAnimator)
|
|
18
|
-
fillColor = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
19
|
-
strokeColor = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
20
|
-
strokeWidth = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
21
|
-
tracking = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
22
|
-
anchor = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
23
|
-
position = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
24
|
-
scale = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
25
|
-
skew = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
26
|
-
skewAxis = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
27
|
-
rotation = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
28
|
-
opacity = try animatorContainer.decodeIfPresent(KeyframeGroup<
|
|
18
|
+
fillColor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieColor>.self, forKey: .fillColor)
|
|
19
|
+
strokeColor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieColor>.self, forKey: .strokeColor)
|
|
20
|
+
strokeWidth = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .strokeWidth)
|
|
21
|
+
tracking = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .tracking)
|
|
22
|
+
anchor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchor)
|
|
23
|
+
position = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
24
|
+
scale = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale)
|
|
25
|
+
skew = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skew)
|
|
26
|
+
skewAxis = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skewAxis)
|
|
27
|
+
rotation = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation)
|
|
28
|
+
opacity = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
init(dictionary: [String: Any]) throws {
|
|
32
32
|
name = (try? dictionary.value(for: CodingKeys.name)) ?? ""
|
|
33
33
|
let animatorDictionary: [String: Any] = try dictionary.value(for: CodingKeys.textAnimator)
|
|
34
34
|
if let fillColorDictionary = animatorDictionary[TextAnimatorKeys.fillColor.rawValue] as? [String: Any] {
|
|
35
|
-
fillColor = try? KeyframeGroup<
|
|
35
|
+
fillColor = try? KeyframeGroup<LottieColor>(dictionary: fillColorDictionary)
|
|
36
36
|
} else {
|
|
37
37
|
fillColor = nil
|
|
38
38
|
}
|
|
39
39
|
if let strokeColorDictionary = animatorDictionary[TextAnimatorKeys.strokeColor.rawValue] as? [String: Any] {
|
|
40
|
-
strokeColor = try? KeyframeGroup<
|
|
40
|
+
strokeColor = try? KeyframeGroup<LottieColor>(dictionary: strokeColorDictionary)
|
|
41
41
|
} else {
|
|
42
42
|
strokeColor = nil
|
|
43
43
|
}
|
|
44
44
|
if let strokeWidthDictionary = animatorDictionary[TextAnimatorKeys.strokeWidth.rawValue] as? [String: Any] {
|
|
45
|
-
strokeWidth = try? KeyframeGroup<
|
|
45
|
+
strokeWidth = try? KeyframeGroup<LottieVector1D>(dictionary: strokeWidthDictionary)
|
|
46
46
|
} else {
|
|
47
47
|
strokeWidth = nil
|
|
48
48
|
}
|
|
49
49
|
if let trackingDictionary = animatorDictionary[TextAnimatorKeys.tracking.rawValue] as? [String: Any] {
|
|
50
|
-
tracking = try? KeyframeGroup<
|
|
50
|
+
tracking = try? KeyframeGroup<LottieVector1D>(dictionary: trackingDictionary)
|
|
51
51
|
} else {
|
|
52
52
|
tracking = nil
|
|
53
53
|
}
|
|
54
54
|
if let anchorDictionary = animatorDictionary[TextAnimatorKeys.anchor.rawValue] as? [String: Any] {
|
|
55
|
-
anchor = try? KeyframeGroup<
|
|
55
|
+
anchor = try? KeyframeGroup<LottieVector3D>(dictionary: anchorDictionary)
|
|
56
56
|
} else {
|
|
57
57
|
anchor = nil
|
|
58
58
|
}
|
|
59
59
|
if let positionDictionary = animatorDictionary[TextAnimatorKeys.position.rawValue] as? [String: Any] {
|
|
60
|
-
position = try? KeyframeGroup<
|
|
60
|
+
position = try? KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
61
61
|
} else {
|
|
62
62
|
position = nil
|
|
63
63
|
}
|
|
64
64
|
if let scaleDictionary = animatorDictionary[TextAnimatorKeys.scale.rawValue] as? [String: Any] {
|
|
65
|
-
scale = try? KeyframeGroup<
|
|
65
|
+
scale = try? KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
66
66
|
} else {
|
|
67
67
|
scale = nil
|
|
68
68
|
}
|
|
69
69
|
if let skewDictionary = animatorDictionary[TextAnimatorKeys.skew.rawValue] as? [String: Any] {
|
|
70
|
-
skew = try? KeyframeGroup<
|
|
70
|
+
skew = try? KeyframeGroup<LottieVector1D>(dictionary: skewDictionary)
|
|
71
71
|
} else {
|
|
72
72
|
skew = nil
|
|
73
73
|
}
|
|
74
74
|
if let skewAxisDictionary = animatorDictionary[TextAnimatorKeys.skewAxis.rawValue] as? [String: Any] {
|
|
75
|
-
skewAxis = try? KeyframeGroup<
|
|
75
|
+
skewAxis = try? KeyframeGroup<LottieVector1D>(dictionary: skewAxisDictionary)
|
|
76
76
|
} else {
|
|
77
77
|
skewAxis = nil
|
|
78
78
|
}
|
|
79
79
|
if let rotationDictionary = animatorDictionary[TextAnimatorKeys.rotation.rawValue] as? [String: Any] {
|
|
80
|
-
rotation = try? KeyframeGroup<
|
|
80
|
+
rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
81
81
|
} else {
|
|
82
82
|
rotation = nil
|
|
83
83
|
}
|
|
84
84
|
if let opacityDictionary = animatorDictionary[TextAnimatorKeys.opacity.rawValue] as? [String: Any] {
|
|
85
|
-
opacity = try KeyframeGroup<
|
|
85
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
86
86
|
} else {
|
|
87
87
|
opacity = nil
|
|
88
88
|
}
|
|
@@ -93,37 +93,37 @@ final class TextAnimator: Codable, DictionaryInitializable {
|
|
|
93
93
|
let name: String
|
|
94
94
|
|
|
95
95
|
/// Anchor
|
|
96
|
-
let anchor: KeyframeGroup<
|
|
96
|
+
let anchor: KeyframeGroup<LottieVector3D>?
|
|
97
97
|
|
|
98
98
|
/// Position
|
|
99
|
-
let position: KeyframeGroup<
|
|
99
|
+
let position: KeyframeGroup<LottieVector3D>?
|
|
100
100
|
|
|
101
101
|
/// Scale
|
|
102
|
-
let scale: KeyframeGroup<
|
|
102
|
+
let scale: KeyframeGroup<LottieVector3D>?
|
|
103
103
|
|
|
104
104
|
/// Skew
|
|
105
|
-
let skew: KeyframeGroup<
|
|
105
|
+
let skew: KeyframeGroup<LottieVector1D>?
|
|
106
106
|
|
|
107
107
|
/// Skew Axis
|
|
108
|
-
let skewAxis: KeyframeGroup<
|
|
108
|
+
let skewAxis: KeyframeGroup<LottieVector1D>?
|
|
109
109
|
|
|
110
110
|
/// Rotation
|
|
111
|
-
let rotation: KeyframeGroup<
|
|
111
|
+
let rotation: KeyframeGroup<LottieVector1D>?
|
|
112
112
|
|
|
113
113
|
/// Opacity
|
|
114
|
-
let opacity: KeyframeGroup<
|
|
114
|
+
let opacity: KeyframeGroup<LottieVector1D>?
|
|
115
115
|
|
|
116
116
|
/// Stroke Color
|
|
117
|
-
let strokeColor: KeyframeGroup<
|
|
117
|
+
let strokeColor: KeyframeGroup<LottieColor>?
|
|
118
118
|
|
|
119
119
|
/// Fill Color
|
|
120
|
-
let fillColor: KeyframeGroup<
|
|
120
|
+
let fillColor: KeyframeGroup<LottieColor>?
|
|
121
121
|
|
|
122
122
|
/// Stroke Width
|
|
123
|
-
let strokeWidth: KeyframeGroup<
|
|
123
|
+
let strokeWidth: KeyframeGroup<LottieVector1D>?
|
|
124
124
|
|
|
125
125
|
/// Tracking
|
|
126
|
-
let tracking: KeyframeGroup<
|
|
126
|
+
let tracking: KeyframeGroup<LottieVector1D>?
|
|
127
127
|
|
|
128
128
|
func encode(to encoder: Encoder) throws {
|
|
129
129
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
@@ -34,24 +34,24 @@ final class TextDocument: Codable, DictionaryInitializable, AnyInitializable {
|
|
|
34
34
|
lineHeight = try dictionary.value(for: CodingKeys.lineHeight)
|
|
35
35
|
baseline = try dictionary.value(for: CodingKeys.baseline)
|
|
36
36
|
if let fillColorRawValue = dictionary[CodingKeys.fillColorData.rawValue] {
|
|
37
|
-
fillColorData = try?
|
|
37
|
+
fillColorData = try? LottieColor(value: fillColorRawValue)
|
|
38
38
|
} else {
|
|
39
39
|
fillColorData = nil
|
|
40
40
|
}
|
|
41
41
|
if let strokeColorRawValue = dictionary[CodingKeys.strokeColorData.rawValue] {
|
|
42
|
-
strokeColorData = try?
|
|
42
|
+
strokeColorData = try? LottieColor(value: strokeColorRawValue)
|
|
43
43
|
} else {
|
|
44
44
|
strokeColorData = nil
|
|
45
45
|
}
|
|
46
46
|
strokeWidth = try? dictionary.value(for: CodingKeys.strokeWidth)
|
|
47
47
|
strokeOverFill = try? dictionary.value(for: CodingKeys.strokeOverFill)
|
|
48
48
|
if let textFramePositionRawValue = dictionary[CodingKeys.textFramePosition.rawValue] {
|
|
49
|
-
textFramePosition = try?
|
|
49
|
+
textFramePosition = try? LottieVector3D(value: textFramePositionRawValue)
|
|
50
50
|
} else {
|
|
51
51
|
textFramePosition = nil
|
|
52
52
|
}
|
|
53
53
|
if let textFrameSizeRawValue = dictionary[CodingKeys.textFrameSize.rawValue] {
|
|
54
|
-
textFrameSize = try?
|
|
54
|
+
textFrameSize = try? LottieVector3D(value: textFrameSizeRawValue)
|
|
55
55
|
} else {
|
|
56
56
|
textFrameSize = nil
|
|
57
57
|
}
|
|
@@ -88,10 +88,10 @@ final class TextDocument: Codable, DictionaryInitializable, AnyInitializable {
|
|
|
88
88
|
let baseline: Double?
|
|
89
89
|
|
|
90
90
|
/// Fill Color data
|
|
91
|
-
let fillColorData:
|
|
91
|
+
let fillColorData: LottieColor?
|
|
92
92
|
|
|
93
93
|
/// Scroke Color data
|
|
94
|
-
let strokeColorData:
|
|
94
|
+
let strokeColorData: LottieColor?
|
|
95
95
|
|
|
96
96
|
/// Stroke Width
|
|
97
97
|
let strokeWidth: Double?
|
|
@@ -99,9 +99,9 @@ final class TextDocument: Codable, DictionaryInitializable, AnyInitializable {
|
|
|
99
99
|
/// Stroke Over Fill
|
|
100
100
|
let strokeOverFill: Bool?
|
|
101
101
|
|
|
102
|
-
let textFramePosition:
|
|
102
|
+
let textFramePosition: LottieVector3D?
|
|
103
103
|
|
|
104
|
-
let textFrameSize:
|
|
104
|
+
let textFrameSize: LottieVector3D?
|
|
105
105
|
|
|
106
106
|
// MARK: Private
|
|
107
107
|
|