BerndK / SvgToXaml

Smart Tool to view svg-files and convert them to xaml for use in .NET
Other
886 stars 164 forks source link

clip geometry error #36

Closed JRY-Zheng closed 3 weeks ago

JRY-Zheng commented 1 year ago

In SvgConverter/ConverterLogic.cs:

//add Attribute: ClipGeometry="M0,0 V40 H40 V0 H0 Z" this is the description of a rectangle-like Geometry
                clipElement.Parent.Add(new XAttribute("ClipGeometry", string.Format(CultureInfo.InvariantCulture, "M{0},{1} V{2} H{3} V{0} H{1} Z", clipRect.Left, clipRect.Top, clipRect.Bottom, clipRect.Right)));

It should be M{0},{1} V{2} H{3} V{1} H{0} rather than V{0} H{1} since {1} is top and {0} is left

BerndK commented 3 weeks ago

Good catch, I fixed that, Thank you.