Commit 9abf0a1a authored by ubbn's avatar ubbn
Browse files

Implemented Path method of SvgImage class

parent b96c50c3
......@@ -23,6 +23,8 @@ namespace Svg
Height = new SvgUnit(0.0f);
}
private GraphicsPath _path;
/// <summary>
/// Gets an <see cref="SvgPoint"/> representing the top left point of the rectangle.
/// </summary>
......@@ -96,7 +98,19 @@ namespace Svg
/// </summary>
public override GraphicsPath Path(ISvgRenderer renderer)
{
return null;
if (_path == null)
{
// Same size of rectangle can suffice to provide bounds of the image
var rectangle = new RectangleF(Location.ToDeviceValue(renderer, this),
SvgUnit.GetDeviceSize(Width, Height, renderer, this));
_path = new GraphicsPath();
_path.StartFigure();
_path.AddRectangle(rectangle);
_path.CloseFigure();
}
return _path;
}
/// <summary>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment