Exemplo n.º 1
0
        public void SetContents(IList <IContent> contentsBefore, IList <IContent> contentsAfter)
        {
            TrimPathContent trimPathContentBefore = null;

            for (var i = contentsBefore.Count - 1; i >= 0; i--)
            {
                var content = contentsBefore[i];
                if (content is TrimPathContent trimPathContent && trimPathContent.Type == ShapeTrimPath.Type.Individually)
                {
                    trimPathContentBefore = trimPathContent;
                }
            }
            if (trimPathContentBefore != null)
            {
                trimPathContentBefore.ValueChanged += OnValueChanged;
            }

            PathGroup currentPathGroup = null;

            for (var i = contentsAfter.Count - 1; i >= 0; i--)
            {
                var content = contentsAfter[i];
                if (content is TrimPathContent trimPathContent && trimPathContent.Type == ShapeTrimPath.Type.Individually)
                {
                    if (currentPathGroup != null)
                    {
                        _pathGroups.Add(currentPathGroup);
                    }
                    currentPathGroup              = new PathGroup(trimPathContent);
                    trimPathContent.ValueChanged += OnValueChanged;
                }
Exemplo n.º 2
0
 internal static void ApplyTrimPathIfNeeded(Path path, TrimPathContent trimPath)
 {
     if (trimPath == null)
     {
         return;
     }
     ApplyTrimPathIfNeeded(path, trimPath.Start.Value.Value / 100f, trimPath.End.Value.Value / 100f, trimPath.Offset.Value.Value / 360f);
 }
Exemplo n.º 3
0
 public void SetContents(List <IContent> contentsBefore, List <IContent> contentsAfter)
 {
     for (var i = 0; i < contentsBefore.Count; i++)
     {
         if (contentsBefore[i] is TrimPathContent trimPathContent && trimPathContent.Type == ShapeTrimPath.Type.Simultaneously)
         {
             _trimPath = trimPathContent;
             _trimPath.ValueChanged += OnValueChanged;
         }
     }
 }
Exemplo n.º 4
0
 public void SetContents(List <IContent> contentsBefore, List <IContent> contentsAfter)
 {
     for (var i = 0; i < contentsBefore.Count; i++)
     {
         if (contentsBefore[i] is TrimPathContent trimPathContent && trimPathContent.Type == ShapeTrimPath.Type.Simultaneously)
         {
             // Trim path individually will be handled by the stroke where paths are combined.
             _trimPath = trimPathContent;
             _trimPath.ValueChanged += OnValueChanged;
         }
     }
 }