You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somewhere between versions 3.0.84 and 3.4.7 the default behaviour of iterating through SvgPathSegmentList changed.
In the 3.0.84 version iterating through the SvgPathSegmentList returns SvgPathSegment result as absolute coordinates of the point.
In the 3.4.7 version the object SvgPathSegment has relative coordinates with an additional property 'IsRelative' set to 'true'
Was the change intentional? I did not find any breaking changes in the release notes.
Is there a flag or a setting I can use to return the default behavior to absolute coordinates without the need to calculate them manually?
Thank you.
The text was updated successfully, but these errors were encountered:
hubaksis
changed the title
Relative and absolute values of SvgPathSegment when iterating through the SvgPathSegmentList
Values of SvgPathSegment became relative (not absolute as earlier) when iterating through the SvgPathSegmentList
May 29, 2024
Workaround that I've currently implemented in my project:
PointF absolutePoint = new PointF(0, 0);
foreach (var point in path.PathData)
{
absolutePoint = ToAbsolute(point.End, point.IsRelative, absolutePoint);
... do what you need to do with the absolutePoint
}
Where ToAbsolute I took from the abstract class SvgPathSegment
protected static PointF ToAbsolute(PointF point, bool isRelative, PointF start)
{
if (float.IsNaN(point.X))
point.X = start.X;
else if (isRelative)
point.X += start.X;
if (float.IsNaN(point.Y))
point.Y = start.Y;
else if (isRelative)
point.Y += start.Y;
return point;
}
Description
Somewhere between versions 3.0.84 and 3.4.7 the default behaviour of iterating through
SvgPathSegmentList
changed.In the 3.0.84 version iterating through the
SvgPathSegmentList
returnsSvgPathSegment
result as absolute coordinates of the point.In the 3.4.7 version the object
SvgPathSegment
has relative coordinates with an additional property 'IsRelative' set to 'true'Example data
<path d="M2639.9,1960.88l1.26,1.11l-0.36,1.79l-1.79,1.58 .....
Was the change intentional? I did not find any breaking changes in the release notes.
Is there a flag or a setting I can use to return the default behavior to absolute coordinates without the need to calculate them manually?
Thank you.
The text was updated successfully, but these errors were encountered: