Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
9abf0a1a
Commit
9abf0a1a
authored
Jul 27, 2015
by
ubbn
Browse files
Implemented Path method of SvgImage class
parent
b96c50c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgImage.cs
View file @
9abf0a1a
...
@@ -23,6 +23,8 @@ namespace Svg
...
@@ -23,6 +23,8 @@ namespace Svg
Height
=
new
SvgUnit
(
0.0f
);
Height
=
new
SvgUnit
(
0.0f
);
}
}
private
GraphicsPath
_path
;
/// <summary>
/// <summary>
/// Gets an <see cref="SvgPoint"/> representing the top left point of the rectangle.
/// Gets an <see cref="SvgPoint"/> representing the top left point of the rectangle.
/// </summary>
/// </summary>
...
@@ -96,7 +98,19 @@ namespace Svg
...
@@ -96,7 +98,19 @@ namespace Svg
/// </summary>
/// </summary>
public
override
GraphicsPath
Path
(
ISvgRenderer
renderer
)
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>
/// <summary>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment