using SvgPathProperties;
using System.Collections.Generic;
using System.Xml.Linq;

namespace PCUT.Extensions.Converters
{
    internal class PathElementConverter : PathConverter
    {
        private static readonly string[] PathExcludedAttributes = new[] { "transform", "d" };
        protected override IEnumerable<string> ExcludedAttributes => PathExcludedAttributes;

        internal PathElementConverter()
        {
        }

        protected override bool CanApply(XElement element) => element.Name.LocalName == "path";

        protected override SvgPath GetPathFromElement(XElement element)
        {
            return new SvgPath(element.Attribute("d").Value, unarc: true);
        }
    }
}
