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
SvgGroup.Bounds does not return the correct bounds if transformations have been applied to the SVG group.
The reason for this is that SvgGroup.Bounds first determines the correct bounds of all child elements and then applies its transformations to these bounds (via SvgElement.TransformedBounds(RectangleF bounds) instead of first applying its transformations to the child elements and determining the bounds afterwards. As a result the returned bounds are the bounds of a transformed rectangle but not the bounds of the contained elements.
Example data
In this example we see a circle in an SVG group. The SVG group has a rotation of 45 degrees around the center of the circle. The group bounds should be tight around the circle but instead the bounding rectangle of the circle is rotated 45 degrees and then the group bounds refer to that, thus making it larger than it acutally should be.
Description
SvgGroup.Bounds
does not return the correct bounds if transformations have been applied to the SVG group.The reason for this is that
SvgGroup.Bounds
first determines the correct bounds of all child elements and then applies its transformations to these bounds (viaSvgElement.TransformedBounds(RectangleF bounds)
instead of first applying its transformations to the child elements and determining the bounds afterwards. As a result the returned bounds are the bounds of a transformed rectangle but not the bounds of the contained elements.Example data
In this example we see a circle in an SVG group. The SVG group has a rotation of 45 degrees around the center of the circle. The group bounds should be tight around the circle but instead the bounding rectangle of the circle is rotated 45 degrees and then the group bounds refer to that, thus making it larger than it acutally should be.
Used Versions
.NET 5.0
SVG.NET 3.4.0
The text was updated successfully, but these errors were encountered: