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
|
@@ -88,10 +88,10 @@ extension Trim {
|
|
|
88
88
|
/// plus a `pathMultiplier` that should be applied to the layer's `path` so that
|
|
89
89
|
/// trim values larger than 100% can be displayed properly.
|
|
90
90
|
fileprivate func caShapeLayerKeyframes(context: LayerAnimationContext) throws
|
|
91
|
-
-> (strokeStart: KeyframeGroup<
|
|
91
|
+
-> (strokeStart: KeyframeGroup<LottieVector1D>, strokeEnd: KeyframeGroup<LottieVector1D>, pathMultiplier: PathMultiplier)
|
|
92
92
|
{
|
|
93
|
-
let strokeStart: KeyframeGroup<
|
|
94
|
-
let strokeEnd: KeyframeGroup<
|
|
93
|
+
let strokeStart: KeyframeGroup<LottieVector1D>
|
|
94
|
+
let strokeEnd: KeyframeGroup<LottieVector1D>
|
|
95
95
|
|
|
96
96
|
// CAShapeLayer requires strokeStart to be less than strokeEnd. This
|
|
97
97
|
// isn't required by the Lottie schema, so some animations may have
|
|
@@ -142,8 +142,8 @@ extension Trim {
|
|
|
142
142
|
if minimumStrokeMultiplier < 0 {
|
|
143
143
|
// Core Animation doesn't support negative stroke offsets, so we have to
|
|
144
144
|
// shift all of the offset values up by the minimum
|
|
145
|
-
adjustedStrokeStart = adjustedStrokeStart.map {
|
|
146
|
-
adjustedStrokeEnd = adjustedStrokeEnd.map {
|
|
145
|
+
adjustedStrokeStart = adjustedStrokeStart.map { LottieVector1D($0.value + (abs(minimumStrokeMultiplier) * 100.0)) }
|
|
146
|
+
adjustedStrokeEnd = adjustedStrokeEnd.map { LottieVector1D($0.value + (abs(minimumStrokeMultiplier) * 100.0)) }
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
return (
|
|
@@ -164,8 +164,8 @@ extension Trim {
|
|
|
164
164
|
|
|
165
165
|
for keyframeTime in keyframeTimes {
|
|
166
166
|
guard
|
|
167
|
-
let startAtTime = startInterpolator.value(frame: keyframeTime) as?
|
|
168
|
-
let endAtTime = endInterpolator.value(frame: keyframeTime) as?
|
|
167
|
+
let startAtTime = startInterpolator.value(frame: keyframeTime) as? LottieVector1D,
|
|
168
|
+
let endAtTime = endInterpolator.value(frame: keyframeTime) as? LottieVector1D
|
|
169
169
|
else { continue }
|
|
170
170
|
|
|
171
171
|
if startAtTime.cgFloatValue < endAtTime.cgFloatValue {
|
|
@@ -184,9 +184,9 @@ extension Trim {
|
|
|
184
184
|
///
|
|
185
185
|
/// - Precondition: The keyframes must be interpolated using `KeyframeGroup.manuallyInterpolateKeyframes()`
|
|
186
186
|
private func adjustKeyframesForTrimOffsets(
|
|
187
|
-
strokeKeyframes: ContiguousArray<Keyframe<
|
|
188
|
-
offsetKeyframes: ContiguousArray<Keyframe<
|
|
189
|
-
context _: LayerAnimationContext) throws -> ContiguousArray<Keyframe<
|
|
187
|
+
strokeKeyframes: ContiguousArray<Keyframe<LottieVector1D>>,
|
|
188
|
+
offsetKeyframes: ContiguousArray<Keyframe<LottieVector1D>>,
|
|
189
|
+
context _: LayerAnimationContext) throws -> ContiguousArray<Keyframe<LottieVector1D>>
|
|
190
190
|
{
|
|
191
191
|
guard
|
|
192
192
|
!strokeKeyframes.isEmpty,
|
|
@@ -196,7 +196,7 @@ extension Trim {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
// Map each time to its corresponding stroke/offset keyframe
|
|
199
|
-
var timeMap = [AnimationFrameTime: [Keyframe<
|
|
199
|
+
var timeMap = [AnimationFrameTime: [Keyframe<LottieVector1D>?]]()
|
|
200
200
|
for stroke in strokeKeyframes {
|
|
201
201
|
timeMap[stroke.time] = [stroke, nil]
|
|
202
202
|
}
|
|
@@ -210,9 +210,9 @@ extension Trim {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// Each time will be mapped to a new, adjusted keyframe
|
|
213
|
-
var output = ContiguousArray<Keyframe<
|
|
214
|
-
var lastKeyframe: Keyframe<
|
|
215
|
-
var lastOffset: Keyframe<
|
|
213
|
+
var output = ContiguousArray<Keyframe<LottieVector1D>>()
|
|
214
|
+
var lastKeyframe: Keyframe<LottieVector1D>?
|
|
215
|
+
var lastOffset: Keyframe<LottieVector1D>?
|
|
216
216
|
|
|
217
217
|
for (time, values) in timeMap.sorted(by: { $0.0 < $1.0 }) {
|
|
218
218
|
// Extract keyframe/offset associated with this timestamp
|
|
@@ -240,8 +240,8 @@ extension Trim {
|
|
|
240
240
|
let adjustedValue = strokeValue + (offsetValue / 360 * 100)
|
|
241
241
|
|
|
242
242
|
// The tangent values are all `nil` as the keyframes should have been manually interpolated
|
|
243
|
-
let adjustedKeyframe = Keyframe<
|
|
244
|
-
value:
|
|
243
|
+
let adjustedKeyframe = Keyframe<LottieVector1D>(
|
|
244
|
+
value: LottieVector1D(adjustedValue),
|
|
245
245
|
time: time,
|
|
246
246
|
isHold: currentKeyframe.isHold,
|
|
247
247
|
inTangent: nil,
|
|
@@ -81,13 +81,13 @@ extension CAShapeLayer {
|
|
|
81
81
|
extension Star {
|
|
82
82
|
/// Data that represents how to render a star at a specific point in time
|
|
83
83
|
struct Keyframe {
|
|
84
|
-
let position:
|
|
85
|
-
let outerRadius:
|
|
86
|
-
let innerRadius:
|
|
87
|
-
let outerRoundness:
|
|
88
|
-
let innerRoundness:
|
|
89
|
-
let points:
|
|
90
|
-
let rotation:
|
|
84
|
+
let position: LottieVector3D
|
|
85
|
+
let outerRadius: LottieVector1D
|
|
86
|
+
let innerRadius: LottieVector1D
|
|
87
|
+
let outerRoundness: LottieVector1D
|
|
88
|
+
let innerRoundness: LottieVector1D
|
|
89
|
+
let points: LottieVector1D
|
|
90
|
+
let rotation: LottieVector1D
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/// Creates a single array of animatable keyframes from the separate arrays of keyframes in this star/polygon
|
|
@@ -95,9 +95,9 @@ extension Star {
|
|
|
95
95
|
let combinedKeyframes = Keyframes.combinedIfPossible(
|
|
96
96
|
position,
|
|
97
97
|
outerRadius,
|
|
98
|
-
innerRadius ?? KeyframeGroup(
|
|
98
|
+
innerRadius ?? KeyframeGroup(LottieVector1D(0)),
|
|
99
99
|
outerRoundness,
|
|
100
|
-
innerRoundness ?? KeyframeGroup(
|
|
100
|
+
innerRoundness ?? KeyframeGroup(LottieVector1D(0)),
|
|
101
101
|
points,
|
|
102
102
|
rotation,
|
|
103
103
|
makeCombinedResult: Star.Keyframe.init)
|
|
@@ -112,10 +112,10 @@ extension Star {
|
|
|
112
112
|
position: positionValue,
|
|
113
113
|
outerRadius: try outerRadius.exactlyOneKeyframe(context: context, description: "star outerRadius"),
|
|
114
114
|
innerRadius: try innerRadius?.exactlyOneKeyframe(context: context, description: "star innerRadius")
|
|
115
|
-
??
|
|
115
|
+
?? LottieVector1D(0),
|
|
116
116
|
outerRoundness: try outerRoundness.exactlyOneKeyframe(context: context, description: "star outerRoundness"),
|
|
117
117
|
innerRoundness: try innerRoundness?.exactlyOneKeyframe(context: context, description: "star innerRoundness")
|
|
118
|
-
??
|
|
118
|
+
?? LottieVector1D(0),
|
|
119
119
|
points: try points.exactlyOneKeyframe(context: context, description: "star points"),
|
|
120
120
|
rotation: try rotation.exactlyOneKeyframe(context: context, description: "star rotation"))
|
|
121
121
|
}
|
|
@@ -8,8 +8,8 @@ import QuartzCore
|
|
|
8
8
|
|
|
9
9
|
/// A `ShapeItem` that represents a stroke
|
|
10
10
|
protocol StrokeShapeItem: OpacityAnimationModel {
|
|
11
|
-
var strokeColor: KeyframeGroup<
|
|
12
|
-
var width: KeyframeGroup<
|
|
11
|
+
var strokeColor: KeyframeGroup<LottieColor>? { get }
|
|
12
|
+
var width: KeyframeGroup<LottieVector1D> { get }
|
|
13
13
|
var lineCap: LineCap { get }
|
|
14
14
|
var lineJoin: LineJoin { get }
|
|
15
15
|
var miterLimit: Double { get }
|
|
@@ -19,13 +19,13 @@ protocol StrokeShapeItem: OpacityAnimationModel {
|
|
|
19
19
|
// MARK: - Stroke + StrokeShapeItem
|
|
20
20
|
|
|
21
21
|
extension Stroke: StrokeShapeItem {
|
|
22
|
-
var strokeColor: KeyframeGroup<
|
|
22
|
+
var strokeColor: KeyframeGroup<LottieColor>? { color }
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// MARK: - GradientStroke + StrokeShapeItem
|
|
26
26
|
|
|
27
27
|
extension GradientStroke: StrokeShapeItem {
|
|
28
|
-
var strokeColor: KeyframeGroup<
|
|
28
|
+
var strokeColor: KeyframeGroup<LottieColor>? { nil }
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// MARK: - CAShapeLayer + StrokeShapeItem
|
|
@@ -10,39 +10,39 @@ import QuartzCore
|
|
|
10
10
|
/// both transform types to share the same animation implementation.
|
|
11
11
|
protocol TransformModel {
|
|
12
12
|
/// The anchor point of the transform.
|
|
13
|
-
var anchorPoint: KeyframeGroup<
|
|
13
|
+
var anchorPoint: KeyframeGroup<LottieVector3D> { get }
|
|
14
14
|
|
|
15
15
|
/// The position of the transform. This is nil if the position data was split.
|
|
16
|
-
var _position: KeyframeGroup<
|
|
16
|
+
var _position: KeyframeGroup<LottieVector3D>? { get }
|
|
17
17
|
|
|
18
18
|
/// The positionX of the transform. This is nil if the position property is set.
|
|
19
|
-
var _positionX: KeyframeGroup<
|
|
19
|
+
var _positionX: KeyframeGroup<LottieVector1D>? { get }
|
|
20
20
|
|
|
21
21
|
/// The positionY of the transform. This is nil if the position property is set.
|
|
22
|
-
var _positionY: KeyframeGroup<
|
|
22
|
+
var _positionY: KeyframeGroup<LottieVector1D>? { get }
|
|
23
23
|
|
|
24
24
|
/// The scale of the transform
|
|
25
|
-
var scale: KeyframeGroup<
|
|
25
|
+
var scale: KeyframeGroup<LottieVector3D> { get }
|
|
26
26
|
|
|
27
27
|
/// The rotation of the transform. Note: This is single dimensional rotation.
|
|
28
|
-
var rotation: KeyframeGroup<
|
|
28
|
+
var rotation: KeyframeGroup<LottieVector1D> { get }
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// MARK: - Transform + TransformModel
|
|
32
32
|
|
|
33
33
|
extension Transform: TransformModel {
|
|
34
|
-
var _position: KeyframeGroup<
|
|
35
|
-
var _positionX: KeyframeGroup<
|
|
36
|
-
var _positionY: KeyframeGroup<
|
|
34
|
+
var _position: KeyframeGroup<LottieVector3D>? { position }
|
|
35
|
+
var _positionX: KeyframeGroup<LottieVector1D>? { positionX }
|
|
36
|
+
var _positionY: KeyframeGroup<LottieVector1D>? { positionY }
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// MARK: - ShapeTransform + TransformModel
|
|
40
40
|
|
|
41
41
|
extension ShapeTransform: TransformModel {
|
|
42
|
-
var anchorPoint: KeyframeGroup<
|
|
43
|
-
var _position: KeyframeGroup<
|
|
44
|
-
var _positionX: KeyframeGroup<
|
|
45
|
-
var _positionY: KeyframeGroup<
|
|
42
|
+
var anchorPoint: KeyframeGroup<LottieVector3D> { anchor }
|
|
43
|
+
var _position: KeyframeGroup<LottieVector3D>? { position }
|
|
44
|
+
var _positionX: KeyframeGroup<LottieVector1D>? { nil }
|
|
45
|
+
var _positionY: KeyframeGroup<LottieVector1D>? { nil }
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// MARK: - CALayer + TransformModel
|
|
@@ -15,7 +15,7 @@ final class CoreAnimationLayer: BaseAnimationLayer {
|
|
|
15
15
|
/// - This initializer is throwing, but will only throw when using
|
|
16
16
|
/// `CompatibilityTracker.Mode.abort`.
|
|
17
17
|
init(
|
|
18
|
-
animation:
|
|
18
|
+
animation: LottieAnimation,
|
|
19
19
|
imageProvider: AnimationImageProvider,
|
|
20
20
|
textProvider: AnimationTextProvider,
|
|
21
21
|
fontProvider: AnimationFontProvider,
|
|
@@ -156,7 +156,7 @@ final class CoreAnimationLayer: BaseAnimationLayer {
|
|
|
156
156
|
} catch {
|
|
157
157
|
if case CompatibilityTracker.Error.encounteredCompatibilityIssue(let compatibilityIssue) = error {
|
|
158
158
|
// Even though the animation setup failed, we still update the layer's playback state
|
|
159
|
-
// so it can be read by the parent `
|
|
159
|
+
// so it can be read by the parent `LottieAnimationView` when handling this error
|
|
160
160
|
currentPlaybackState = pendingAnimationConfiguration.playbackState
|
|
161
161
|
|
|
162
162
|
didSetUpAnimation?([compatibilityIssue])
|
|
@@ -187,7 +187,7 @@ final class CoreAnimationLayer: BaseAnimationLayer {
|
|
|
187
187
|
/// which is also the realtime animation progress of this layer's animation
|
|
188
188
|
@objc private var animationProgress: CGFloat = 0
|
|
189
189
|
|
|
190
|
-
private let animation:
|
|
190
|
+
private let animation: LottieAnimation
|
|
191
191
|
private let valueProviderStore: ValueProviderStore
|
|
192
192
|
private let compatibilityTracker: CompatibilityTracker
|
|
193
193
|
private let logger: LottieLogger
|
|
@@ -18,7 +18,7 @@ protocol AnimationLayer: CALayer {
|
|
|
18
18
|
// Context describing the timing parameters of the current animation
|
|
19
19
|
struct LayerAnimationContext {
|
|
20
20
|
/// The animation being played
|
|
21
|
-
let animation:
|
|
21
|
+
let animation: LottieAnimation
|
|
22
22
|
|
|
23
23
|
/// The timing configuration that should be applied to `CAAnimation`s
|
|
24
24
|
let timingConfiguration: CoreAnimationLayer.CAMediaTimingConfiguration
|
|
@@ -15,7 +15,7 @@ extension CALayer {
|
|
|
15
15
|
context: LayerContext)
|
|
16
16
|
throws
|
|
17
17
|
{
|
|
18
|
-
//
|
|
18
|
+
// A `LottieAnimation`'s `LayerModel`s are listed from front to back,
|
|
19
19
|
// but `CALayer.sublayers` are listed from back to front.
|
|
20
20
|
// We reverse the layer ordering to match what Core Animation expects.
|
|
21
21
|
// The final view hierarchy must display the layers in this exact order.
|
|
@@ -7,7 +7,7 @@ import QuartzCore
|
|
|
7
7
|
|
|
8
8
|
/// Context available when constructing an `AnimationLayer`
|
|
9
9
|
struct LayerContext {
|
|
10
|
-
let animation:
|
|
10
|
+
let animation: LottieAnimation
|
|
11
11
|
let imageProvider: AnimationImageProvider
|
|
12
12
|
let textProvider: AnimationTextProvider
|
|
13
13
|
let fontProvider: AnimationFontProvider
|
|
@@ -108,7 +108,7 @@ extension PreCompLayer: CustomLayoutLayer {
|
|
|
108
108
|
extension KeyframeInterpolator where ValueType == AnimationFrameTime {
|
|
109
109
|
/// A `KeyframeInterpolator` for the given `timeRemapping` keyframes
|
|
110
110
|
static func timeRemapping(
|
|
111
|
-
keyframes timeRemappingKeyframes: KeyframeGroup<
|
|
111
|
+
keyframes timeRemappingKeyframes: KeyframeGroup<LottieVector1D>,
|
|
112
112
|
context: LayerContext)
|
|
113
113
|
throws
|
|
114
114
|
-> KeyframeInterpolator<AnimationFrameTime>
|
|
@@ -56,11 +56,11 @@ private struct RepeaterTransform {
|
|
|
56
56
|
scale = repeater.scale
|
|
57
57
|
|
|
58
58
|
rotation = repeater.rotation.map { rotation in
|
|
59
|
-
|
|
59
|
+
LottieVector1D(rotation.value * Double(index))
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
position = repeater.position.map { position in
|
|
63
|
-
|
|
63
|
+
LottieVector3D(
|
|
64
64
|
x: position.x * Double(index),
|
|
65
65
|
y: position.y * Double(index),
|
|
66
66
|
z: position.z * Double(index))
|
|
@@ -69,17 +69,17 @@ private struct RepeaterTransform {
|
|
|
69
69
|
|
|
70
70
|
// MARK: Internal
|
|
71
71
|
|
|
72
|
-
let anchorPoint: KeyframeGroup<
|
|
73
|
-
let position: KeyframeGroup<
|
|
74
|
-
let rotation: KeyframeGroup<
|
|
75
|
-
let scale: KeyframeGroup<
|
|
72
|
+
let anchorPoint: KeyframeGroup<LottieVector3D>
|
|
73
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
74
|
+
let rotation: KeyframeGroup<LottieVector1D>
|
|
75
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
76
76
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// MARK: TransformModel
|
|
80
80
|
|
|
81
81
|
extension RepeaterTransform: TransformModel {
|
|
82
|
-
var _position: KeyframeGroup<
|
|
83
|
-
var _positionX: KeyframeGroup<
|
|
84
|
-
var _positionY: KeyframeGroup<
|
|
82
|
+
var _position: KeyframeGroup<LottieVector3D>? { position }
|
|
83
|
+
var _positionX: KeyframeGroup<LottieVector1D>? { nil }
|
|
84
|
+
var _positionY: KeyframeGroup<LottieVector1D>? { nil }
|
|
85
85
|
}
|
|
@@ -157,7 +157,7 @@ final class GroupLayer: BaseAnimationLayer {
|
|
|
157
157
|
// interpolate the path for each shape at each frame ahead of time so we can combine them
|
|
158
158
|
// into a single set of bezier path keyframes.
|
|
159
159
|
else {
|
|
160
|
-
combinedShape = .manuallyInterpolating(shapes: allPathKeyframes, name: group.name
|
|
160
|
+
combinedShape = .manuallyInterpolating(shapes: allPathKeyframes, name: group.name)
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
let sublayer = try ShapeItemLayer(
|
|
@@ -6,7 +6,7 @@ import QuartzCore
|
|
|
6
6
|
// MARK: - ValueProviderStore
|
|
7
7
|
|
|
8
8
|
/// Registration and storage for `AnyValueProvider`s that can dynamically
|
|
9
|
-
/// provide custom values for `AnimationKeypath`s within
|
|
9
|
+
/// provide custom values for `AnimationKeypath`s within a `LottieAnimation`.
|
|
10
10
|
final class ValueProviderStore {
|
|
11
11
|
|
|
12
12
|
// MARK: Lifecycle
|
|
@@ -183,7 +183,7 @@ private class MaskNodeProperties: NodePropertyMap {
|
|
|
183
183
|
let mode: MaskMode
|
|
184
184
|
let inverted: Bool
|
|
185
185
|
|
|
186
|
-
let opacity: NodeProperty<
|
|
186
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
187
187
|
let shape: NodeProperty<BezierPath>
|
|
188
|
-
let expansion: NodeProperty<
|
|
188
|
+
let expansion: NodeProperty<LottieVector1D>
|
|
189
189
|
}
|
|
@@ -90,7 +90,7 @@ final class PreCompositionLayer: CompositionLayer {
|
|
|
90
90
|
// MARK: Internal
|
|
91
91
|
|
|
92
92
|
let frameRate: CGFloat
|
|
93
|
-
let remappingNode: NodeProperty<
|
|
93
|
+
let remappingNode: NodeProperty<LottieVector1D>?
|
|
94
94
|
|
|
95
95
|
override var keypathProperties: [String: AnyNodeProperty] {
|
|
96
96
|
guard let remappingNode = remappingNode else {
|
|
@@ -15,7 +15,7 @@ final class SolidCompositionLayer: CompositionLayer {
|
|
|
15
15
|
init(solid: SolidLayerModel) {
|
|
16
16
|
let components = solid.colorHex.hexColorComponents()
|
|
17
17
|
colorProperty =
|
|
18
|
-
NodeProperty(provider: SingleValueProvider(
|
|
18
|
+
NodeProperty(provider: SingleValueProvider(LottieColor(
|
|
19
19
|
r: Double(components.red),
|
|
20
20
|
g: Double(components.green),
|
|
21
21
|
b: Double(components.blue),
|
|
@@ -41,7 +41,7 @@ final class SolidCompositionLayer: CompositionLayer {
|
|
|
41
41
|
|
|
42
42
|
// MARK: Internal
|
|
43
43
|
|
|
44
|
-
let colorProperty: NodeProperty<
|
|
44
|
+
let colorProperty: NodeProperty<LottieColor>?
|
|
45
45
|
let solidShape = CAShapeLayer()
|
|
46
46
|
|
|
47
47
|
override var keypathProperties: [String: AnyNodeProperty] {
|
|
@@ -19,7 +19,7 @@ final class MainThreadAnimationLayer: CALayer, RootAnimationLayer {
|
|
|
19
19
|
// MARK: Lifecycle
|
|
20
20
|
|
|
21
21
|
init(
|
|
22
|
-
animation:
|
|
22
|
+
animation: LottieAnimation,
|
|
23
23
|
imageProvider: AnimationImageProvider,
|
|
24
24
|
textProvider: AnimationTextProvider,
|
|
25
25
|
fontProvider: AnimationFontProvider,
|
|
@@ -152,7 +152,7 @@ final class MainThreadAnimationLayer: CALayer, RootAnimationLayer {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
var isAnimationPlaying: Bool? {
|
|
155
|
-
nil // this state is managed by `
|
|
155
|
+
nil // this state is managed by `LottieAnimationView`
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
var _animationLayers: [CALayer] {
|
|
@@ -189,7 +189,7 @@ final class MainThreadAnimationLayer: CALayer, RootAnimationLayer {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
func removeAnimations() {
|
|
192
|
-
// no-op, since the primary animation is managed by the `
|
|
192
|
+
// no-op, since the primary animation is managed by the `LottieAnimationView`.
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/// Forces the view to update its drawing.
|
|
@@ -32,15 +32,15 @@ final class LayerTransformProperties: NodePropertyMap, KeypathSearchable {
|
|
|
32
32
|
let positionKeyframesX = transform.positionX?.keyframes,
|
|
33
33
|
let positionKeyframesY = transform.positionY?.keyframes
|
|
34
34
|
{
|
|
35
|
-
let xPosition: NodeProperty<
|
|
36
|
-
let yPosition: NodeProperty<
|
|
35
|
+
let xPosition: NodeProperty<LottieVector1D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframesX))
|
|
36
|
+
let yPosition: NodeProperty<LottieVector1D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframesY))
|
|
37
37
|
propertyMap["X Position"] = xPosition
|
|
38
38
|
propertyMap["Y Position"] = yPosition
|
|
39
39
|
positionX = xPosition
|
|
40
40
|
positionY = yPosition
|
|
41
41
|
position = nil
|
|
42
42
|
} else if let positionKeyframes = transform.position?.keyframes {
|
|
43
|
-
let position: NodeProperty<
|
|
43
|
+
let position: NodeProperty<LottieVector3D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframes))
|
|
44
44
|
propertyMap["Position"] = position
|
|
45
45
|
self.position = position
|
|
46
46
|
positionX = nil
|
|
@@ -62,13 +62,13 @@ final class LayerTransformProperties: NodePropertyMap, KeypathSearchable {
|
|
|
62
62
|
|
|
63
63
|
let properties: [AnyNodeProperty]
|
|
64
64
|
|
|
65
|
-
let anchor: NodeProperty<
|
|
66
|
-
let scale: NodeProperty<
|
|
67
|
-
let rotation: NodeProperty<
|
|
68
|
-
let position: NodeProperty<
|
|
69
|
-
let positionX: NodeProperty<
|
|
70
|
-
let positionY: NodeProperty<
|
|
71
|
-
let opacity: NodeProperty<
|
|
65
|
+
let anchor: NodeProperty<LottieVector3D>
|
|
66
|
+
let scale: NodeProperty<LottieVector3D>
|
|
67
|
+
let rotation: NodeProperty<LottieVector1D>
|
|
68
|
+
let position: NodeProperty<LottieVector3D>?
|
|
69
|
+
let positionX: NodeProperty<LottieVector1D>?
|
|
70
|
+
let positionY: NodeProperty<LottieVector1D>?
|
|
71
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
72
72
|
|
|
73
73
|
var childKeypaths: [KeypathSearchable] {
|
|
74
74
|
[]
|
|
@@ -80,7 +80,7 @@ extension Array where Element == ShapeItem {
|
|
|
80
80
|
nodeTree.paths.append(contentsOf: tree.paths)
|
|
81
81
|
nodeTree.renderContainers.append(node.container)
|
|
82
82
|
} else if item is Repeater {
|
|
83
|
-
LottieLogger.shared.
|
|
83
|
+
LottieLogger.shared.warn("""
|
|
84
84
|
The Main Thread rendering engine doesn't currently support repeaters.
|
|
85
85
|
To play an animation with repeaters, you can use the Core Animation rendering engine instead.
|
|
86
86
|
""")
|
|
@@ -34,9 +34,9 @@ final class TrimPathProperties: NodePropertyMap, KeypathSearchable {
|
|
|
34
34
|
let properties: [AnyNodeProperty]
|
|
35
35
|
let keypathName: String
|
|
36
36
|
|
|
37
|
-
let start: NodeProperty<
|
|
38
|
-
let end: NodeProperty<
|
|
39
|
-
let offset: NodeProperty<
|
|
37
|
+
let start: NodeProperty<LottieVector1D>
|
|
38
|
+
let end: NodeProperty<LottieVector1D>
|
|
39
|
+
let offset: NodeProperty<LottieVector1D>
|
|
40
40
|
let type: TrimType
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -31,8 +31,8 @@ final class EllipseNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
31
31
|
var keypathName: String
|
|
32
32
|
|
|
33
33
|
let direction: PathDirection
|
|
34
|
-
let position: NodeProperty<
|
|
35
|
-
let size: NodeProperty<
|
|
34
|
+
let position: NodeProperty<LottieVector3D>
|
|
35
|
+
let size: NodeProperty<LottieVector3D>
|
|
36
36
|
|
|
37
37
|
let keypathProperties: [String: AnyNodeProperty]
|
|
38
38
|
let properties: [AnyNodeProperty]
|
|
@@ -42,11 +42,11 @@ final class PolygonNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
42
42
|
let properties: [AnyNodeProperty]
|
|
43
43
|
|
|
44
44
|
let direction: PathDirection
|
|
45
|
-
let position: NodeProperty<
|
|
46
|
-
let outerRadius: NodeProperty<
|
|
47
|
-
let outerRoundedness: NodeProperty<
|
|
48
|
-
let rotation: NodeProperty<
|
|
49
|
-
let points: NodeProperty<
|
|
45
|
+
let position: NodeProperty<LottieVector3D>
|
|
46
|
+
let outerRadius: NodeProperty<LottieVector1D>
|
|
47
|
+
let outerRoundedness: NodeProperty<LottieVector1D>
|
|
48
|
+
let rotation: NodeProperty<LottieVector1D>
|
|
49
|
+
let points: NodeProperty<LottieVector1D>
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// MARK: - PolygonNode
|
|
@@ -38,9 +38,9 @@ final class RectNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
38
38
|
let properties: [AnyNodeProperty]
|
|
39
39
|
|
|
40
40
|
let direction: PathDirection
|
|
41
|
-
let position: NodeProperty<
|
|
42
|
-
let size: NodeProperty<
|
|
43
|
-
let cornerRadius: NodeProperty<
|
|
41
|
+
let position: NodeProperty<LottieVector3D>
|
|
42
|
+
let size: NodeProperty<LottieVector3D>
|
|
43
|
+
let cornerRadius: NodeProperty<LottieVector1D>
|
|
44
44
|
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -23,12 +23,12 @@ final class StarNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
23
23
|
if let innerRadiusKeyframes = star.innerRadius?.keyframes {
|
|
24
24
|
innerRadius = NodeProperty(provider: KeyframeInterpolator(keyframes: innerRadiusKeyframes))
|
|
25
25
|
} else {
|
|
26
|
-
innerRadius = NodeProperty(provider: SingleValueProvider(
|
|
26
|
+
innerRadius = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
27
27
|
}
|
|
28
28
|
if let innderRoundedness = star.innerRoundness?.keyframes {
|
|
29
29
|
innerRoundedness = NodeProperty(provider: KeyframeInterpolator(keyframes: innderRoundedness))
|
|
30
30
|
} else {
|
|
31
|
-
innerRoundedness = NodeProperty(provider: SingleValueProvider(
|
|
31
|
+
innerRoundedness = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
32
32
|
}
|
|
33
33
|
rotation = NodeProperty(provider: KeyframeInterpolator(keyframes: star.rotation.keyframes))
|
|
34
34
|
points = NodeProperty(provider: KeyframeInterpolator(keyframes: star.points.keyframes))
|
|
@@ -52,13 +52,13 @@ final class StarNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
52
52
|
let properties: [AnyNodeProperty]
|
|
53
53
|
|
|
54
54
|
let direction: PathDirection
|
|
55
|
-
let position: NodeProperty<
|
|
56
|
-
let outerRadius: NodeProperty<
|
|
57
|
-
let outerRoundedness: NodeProperty<
|
|
58
|
-
let innerRadius: NodeProperty<
|
|
59
|
-
let innerRoundedness: NodeProperty<
|
|
60
|
-
let rotation: NodeProperty<
|
|
61
|
-
let points: NodeProperty<
|
|
55
|
+
let position: NodeProperty<LottieVector3D>
|
|
56
|
+
let outerRadius: NodeProperty<LottieVector1D>
|
|
57
|
+
let outerRoundedness: NodeProperty<LottieVector1D>
|
|
58
|
+
let innerRadius: NodeProperty<LottieVector1D>
|
|
59
|
+
let innerRoundedness: NodeProperty<LottieVector1D>
|
|
60
|
+
let rotation: NodeProperty<LottieVector1D>
|
|
61
|
+
let points: NodeProperty<LottieVector1D>
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// MARK: - StarNode
|
|
@@ -26,13 +26,13 @@ final class GroupNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
26
26
|
skewAxis = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.skewAxis.keyframes))
|
|
27
27
|
} else {
|
|
28
28
|
/// Transform node missing. Default to empty transform.
|
|
29
|
-
anchor = NodeProperty(provider: SingleValueProvider(
|
|
30
|
-
position = NodeProperty(provider: SingleValueProvider(
|
|
31
|
-
scale = NodeProperty(provider: SingleValueProvider(
|
|
32
|
-
rotation = NodeProperty(provider: SingleValueProvider(
|
|
33
|
-
opacity = NodeProperty(provider: SingleValueProvider(
|
|
34
|
-
skew = NodeProperty(provider: SingleValueProvider(
|
|
35
|
-
skewAxis = NodeProperty(provider: SingleValueProvider(
|
|
29
|
+
anchor = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(0), y: CGFloat(0), z: CGFloat(0))))
|
|
30
|
+
position = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(0), y: CGFloat(0), z: CGFloat(0))))
|
|
31
|
+
scale = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(100), y: CGFloat(100), z: CGFloat(100))))
|
|
32
|
+
rotation = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
33
|
+
opacity = NodeProperty(provider: SingleValueProvider(LottieVector1D(100)))
|
|
34
|
+
skew = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
35
|
+
skewAxis = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
36
36
|
}
|
|
37
37
|
keypathProperties = [
|
|
38
38
|
"Anchor Point" : anchor,
|
|
@@ -55,13 +55,13 @@ final class GroupNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
55
55
|
let keypathProperties: [String: AnyNodeProperty]
|
|
56
56
|
let properties: [AnyNodeProperty]
|
|
57
57
|
|
|
58
|
-
let anchor: NodeProperty<
|
|
59
|
-
let position: NodeProperty<
|
|
60
|
-
let scale: NodeProperty<
|
|
61
|
-
let rotation: NodeProperty<
|
|
62
|
-
let opacity: NodeProperty<
|
|
63
|
-
let skew: NodeProperty<
|
|
64
|
-
let skewAxis: NodeProperty<
|
|
58
|
+
let anchor: NodeProperty<LottieVector3D>
|
|
59
|
+
let position: NodeProperty<LottieVector3D>
|
|
60
|
+
let scale: NodeProperty<LottieVector3D>
|
|
61
|
+
let rotation: NodeProperty<LottieVector1D>
|
|
62
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
63
|
+
let skew: NodeProperty<LottieVector1D>
|
|
64
|
+
let skewAxis: NodeProperty<LottieVector1D>
|
|
65
65
|
|
|
66
66
|
var caTransform: CATransform3D {
|
|
67
67
|
CATransform3D.makeTransform(
|
|
@@ -30,8 +30,8 @@ final class FillNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
|
30
30
|
|
|
31
31
|
var keypathName: String
|
|
32
32
|
|
|
33
|
-
let opacity: NodeProperty<
|
|
34
|
-
let color: NodeProperty<
|
|
33
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
34
|
+
let color: NodeProperty<LottieColor>
|
|
35
35
|
let type: FillRule
|
|
36
36
|
|
|
37
37
|
let keypathProperties: [String: AnyNodeProperty]
|
package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift
CHANGED
|
@@ -36,9 +36,9 @@ final class GradientFillProperties: NodePropertyMap, KeypathSearchable {
|
|
|
36
36
|
|
|
37
37
|
var keypathName: String
|
|
38
38
|
|
|
39
|
-
let opacity: NodeProperty<
|
|
40
|
-
let startPoint: NodeProperty<
|
|
41
|
-
let endPoint: NodeProperty<
|
|
39
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
40
|
+
let startPoint: NodeProperty<LottieVector3D>
|
|
41
|
+
let endPoint: NodeProperty<LottieVector3D>
|
|
42
42
|
let colors: NodeProperty<[Double]>
|
|
43
43
|
|
|
44
44
|
let gradientType: GradientType
|