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
de607321
Commit
de607321
authored
Aug 23, 2017
by
Fr33dan
Committed by
mrbean-bremen
Dec 20, 2018
Browse files
Added optional size parameter to the Draw method that renders on a Graphics object.
parent
ec99fa95
Changes
1
Show whitespace changes
Inline
Side-by-side
Source/SvgDocument.cs
View file @
de607321
...
...
@@ -422,8 +422,9 @@ namespace Svg
/// Renders the <see cref="SvgDocument"/> to the specified <see cref="Graphics"/>.
/// </summary>
/// <param name="graphics">The <see cref="Graphics"/> to be rendered to.</param>
/// <param name="size">The <see cref="SizeF"/> to render the document.</param>
/// <exception cref="ArgumentNullException">The <paramref name="graphics"/> parameter cannot be <c>null</c>.</exception>
public
void
Draw
(
Graphics
graphics
)
public
void
Draw
(
Graphics
graphics
,
SizeF
?
size
=
null
)
{
if
(
graphics
==
null
)
{
...
...
@@ -431,7 +432,14 @@ namespace Svg
}
var
renderer
=
SvgRenderer
.
FromGraphics
(
graphics
);
if
(
size
.
HasValue
)
{
renderer
.
SetBoundable
(
new
GenericBoundable
(
0
,
0
,
size
.
Value
.
Width
,
size
.
Value
.
Height
));
}
else
{
renderer
.
SetBoundable
(
this
);
}
this
.
Render
(
renderer
);
}
...
...
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