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
0e75e619
Commit
0e75e619
authored
Apr 17, 2014
by
Tebjan Halm
Browse files
Merge pull request #60 from HarkDev/master
Fixed Bound Calculation
parents
c1ce332d
02ee6c04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Document Structure/SvgGroup.cs
View file @
0e75e619
...
...
@@ -47,10 +47,18 @@ namespace Svg
var
r
=
new
RectangleF
();
foreach
(
var
c
in
this
.
Children
)
{
if
(
c
is
SvgVisualElement
)
r
=
RectangleF
.
Union
(
r
,
((
SvgVisualElement
)
c
).
Bounds
);
if
(
c
is
SvgVisualElement
)
{
// First it should check if rectangle is empty or it will return the wrong Bounds.
// This is because when the Rectangle is Empty, the Union method adds as if the first values where X=0, Y=0
if
(
r
.
IsEmpty
)
r
=
((
SvgVisualElement
)
c
).
Bounds
;
else
r
=
RectangleF
.
Union
(
r
,
((
SvgVisualElement
)
c
).
Bounds
);
}
}
return
r
;
return
r
;
}
}
...
...
@@ -81,4 +89,4 @@ namespace Svg
return
newObj
;
}
}
}
\ No newline at end of file
}
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