internal StrokeContent(Lottie lottie, BaseLayer layer, ShapeStroke stroke) : base(lottie, layer, ShapeStroke.LineCapTypeToPaintCap(stroke.CapType), ShapeStroke.LineJoinTypeToPaintLineJoin(stroke.JoinType), stroke.MiterLimit, stroke.Opacity, stroke.Width, stroke.LineDashPattern, stroke.DashOffset) { _layer = layer; Name = stroke.Name; _colorAnimation = stroke.Color.CreateAnimation(); _colorAnimation.ValueChanged += OnValueChanged; layer.AddAnimation(_colorAnimation); }
internal GradientStrokeContent(LottieDrawable lottieDrawable, BaseLayer layer, GradientStroke stroke) : base(lottieDrawable, layer, ShapeStroke.LineCapTypeToPaintCap(stroke.CapType), ShapeStroke.LineJoinTypeToPaintLineJoin(stroke.JoinType), stroke.MiterLimit, stroke.Opacity, stroke.Width, stroke.LineDashPattern, stroke.DashOffset) { Name = stroke.Name; _type = stroke.GradientType; _cacheSteps = (int)(lottieDrawable.Composition.Duration / CacheStepsMs); _colorAnimation = stroke.GradientColor.CreateAnimation(); _colorAnimation.ValueChanged += OnValueChanged; layer.AddAnimation(_colorAnimation); _startPointAnimation = stroke.StartPoint.CreateAnimation(); _startPointAnimation.ValueChanged += OnValueChanged; layer.AddAnimation(_startPointAnimation); _endPointAnimation = stroke.EndPoint.CreateAnimation(); _endPointAnimation.ValueChanged += OnValueChanged; layer.AddAnimation(_endPointAnimation); }