Пример #1
0
        YamlObject FromSolidColorStroke(SolidColorStroke content, YamlMap superclassContent)
        {
            var result = superclassContent;

            result.Add(nameof(content.Color), FromAnimatable(content.Color));
            return(result);
        }
        YamlObject FromSolidColorStroke(SolidColorStroke content, YamlMap superclassContent)
        {
            var result = superclassContent;

            result.Add("Color", FromAnimatable(content.Color, FromColor));
            result.Add("OpacityPercent", FromAnimatable(content.OpacityPercent));
            result.Add("Thickness", FromAnimatable(content.Thickness));
            return(result);
        }
Пример #3
0
        XElement FromSolidColorStroke(SolidColorStroke content)
        {
            return(new XElement("SolidColorStroke", GetContents()));

            IEnumerable <XObject> GetContents()
            {
                foreach (var item in GetShapeLayerContentContents(content))
                {
                    yield return(item);
                }

                yield return(FromAnimatable(nameof(content.Color), content.Color));

                yield return(FromAnimatable(nameof(content.Opacity), content.Opacity));

                yield return(FromAnimatable(nameof(content.StrokeWidth), content.StrokeWidth));
            }
        }
Пример #4
0
        SolidColorStroke ComposeSolidColorStrokes(SolidColorStroke a, SolidColorStroke b)
        {
            Debug.Assert(a != null && b != null, "Precondition");

            if (!a.StrokeWidth.IsAnimated && !b.StrokeWidth.IsAnimated &&
                !a.DashPattern.Any() && !b.DashPattern.Any() &&
                a.Opacity.IsAlways(LottieData.Opacity.Opaque) && b.Opacity.IsAlways(LottieData.Opacity.Opaque))
            {
                if (a.StrokeWidth.InitialValue >= b.StrokeWidth.InitialValue)
                {
                    // a occludes b, so b can be ignored.
                    return(a);
                }
            }

            // The new stroke should be in addition to the existing stroke. And colors should blend.
            Translation.Issues.MultipleStrokesIsNotSupported();
            return(b);
        }