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
cc4f2940
Commit
cc4f2940
authored
Sep 15, 2014
by
Ritch Melton
Browse files
Removed Trim() condition to allow for whitespace strings
parent
d9e96ccf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Text/SvgTextBase.cs
View file @
cc4f2940
...
...
@@ -335,14 +335,10 @@ namespace Svg
/// <value></value>
public
override
GraphicsPath
Path
(
SvgRenderer
renderer
)
{
//
Make sure the p
ath i
s always null if there is no text
//
When an empty string is passed to GraphicsP
ath
,
i
t raises an InvalidArgumentException.
//if there is a TSpan inside of this text element then path should not be null (even if this text is empty!)
if
((
string
.
IsNullOrEmpty
(
Text
)
||
Text
.
Trim
().
Length
<
1
)
&&
!
Children
.
Any
(
x
=>
x
is
SvgTextSpan
))
return
_path
=
null
;
//NOT SURE WHAT THIS IS ABOUT - Path gets created again anyway - WTF?
// When an empty string is passed to GraphicsPath, it rises an InvalidArgumentException...
if
(
_path
==
null
||
this
.
IsPathDirty
)
var
isInvalidText
=
string
.
IsNullOrEmpty
(
Text
)
&&
!
Children
.
Any
(
x
=>
x
is
SvgTextSpan
);
if
(
_path
==
null
||
IsPathDirty
||
isInvalidText
)
{
renderer
=
(
renderer
??
SvgRenderer
.
FromNull
());
// Measure the overall bounds of all the text
...
...
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