Comparing the handling of the RectangleShape in SVGRender, there was a change in the original code, in particular, the construction of the RectangleGeometry. The results of the change is that some of the original sample files, like computer-aj_aj_ashton_01.svg, are now throwing exceptions.
Simply reverting to the original construction code fixes this bug, but what issue was fixed with the current changes?
The original is
if (shape is ClipArtViewer.RectangleShape)
{
ClipArtViewer.RectangleShape r = shape as ClipArtViewer.RectangleShape;
RectangleGeometry rect = new RectangleGeometry(new Rect(r.X, r.Y, r.Width, r.Height));
rect.RadiusX = r.RX;
rect.RadiusY = r.RY;
if (rect.RadiusX == 0 && rect.RadiusY > 0)
rect.RadiusX = rect.RadiusY;
grp.Children.Add(NewDrawingItem(shape, rect));
}
and the current version is
if (shape is RectangleShape)
{
RectangleShape r = shape as RectangleShape;
RectangleGeometry rect = new RectangleGeometry(new Rect(r.X < 0 ? 0 : r.X, r.Y < 0 ? 0 : r.Y, r.X < 0 ? r.Width + r.X : r.Width, r.Y < 0 ? r.Height + r.Y : r.Height));
rect.RadiusX = r.RX;
rect.RadiusY = r.RY;
if (rect.RadiusX == 0 && rect.RadiusY > 0) rect.RadiusX = rect.RadiusY;
var di = this.NewDrawingItem(shape, rect);
AddDrawingToGroup(grp, shape, di);
continue;
}
Comparing the handling of the
RectangleShape
inSVGRender
, there was a change in the original code, in particular, the construction of theRectangleGeometry
. The results of the change is that some of the original sample files, like computer-aj_aj_ashton_01.svg, are now throwing exceptions. Simply reverting to the original construction code fixes this bug, but what issue was fixed with the current changes?The original is
and the current version is