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
23143bb7
Commit
23143bb7
authored
Dec 07, 2011
by
Tebjan Halm
Browse files
* fixed getPath bug
* added implicit operator from RectangleF to SvgViewBox
parent
fafb1444
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/DataTypes/SvgViewBox.cs
View file @
23143bb7
...
...
@@ -60,6 +60,16 @@ namespace Svg
{
return
new
RectangleF
(
value
.
MinX
,
value
.
MinY
,
value
.
Width
,
value
.
Height
);
}
/// <summary>
/// Performs an implicit conversion from <see cref="System.Drawing.RectangleF"/> to <see cref="Svg.SvgViewBox"/>.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public
static
implicit
operator
SvgViewBox
(
RectangleF
value
)
{
return
new
SvgViewBox
(
value
.
X
,
value
.
Y
,
value
.
Width
,
value
.
Height
);
}
/// <summary>
/// Initializes a new instance of the <see cref="SvgViewBox"/> struct.
...
...
Source/SvgElement.cs
View file @
23143bb7
...
...
@@ -413,25 +413,23 @@ namespace Svg
/// <param name="path"></param>
protected
void
AddPaths
(
SvgElement
elem
,
GraphicsPath
path
)
{
foreach
(
var
c
in
elem
.
Children
)
foreach
(
var
c
hild
in
elem
.
Children
)
{
if
(
c
is
SvgVisualElement
)
if
(
!(
child
is
SvgGroup
)
&&
child
is
SvgVisualElement
)
{
var
c
p
=
((
SvgVisualElement
)
c
).
Path
;
var
c
hildPath
=
((
SvgVisualElement
)
c
hild
).
Path
;
if
(
cp
!=
null
)
if
(
childPath
!=
null
)
{
c
p
=
(
GraphicsPath
)
c
p
.
Clone
();
if
(
c
.
Transforms
!=
null
)
c
p
.
Transform
(
c
.
Transforms
.
GetMatrix
());
c
hildPath
=
(
GraphicsPath
)
c
hildPath
.
Clone
();
if
(
c
hild
.
Transforms
!=
null
)
c
hildPath
.
Transform
(
c
hild
.
Transforms
.
GetMatrix
());
path
.
AddPath
(
c
p
,
false
);
path
.
AddPath
(
c
hildPath
,
false
);
}
}
AddPaths
(
c
,
path
);
AddPaths
(
c
hild
,
path
);
}
}
...
...
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