Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
10 years ago
by
Ritch Melton
Browse files
Options
Download
Email Patches
Plain Diff
Removed Trim() condition to allow for whitespace strings
parent
d9e96ccf
master
netstandard2
nuget2.4.2
nuget2.4.1
nuget2.4
nuget2.3
nuget2.2.2
nuget2.2.1
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Text/SvgTextBase.cs
+3
-7
Source/Text/SvgTextBase.cs
with
3 additions
and
7 deletions
+3
-7
Source/Text/SvgTextBase.cs
+
3
-
7
View file @
cc4f2940
...
@@ -335,14 +335,10 @@ namespace Svg
...
@@ -335,14 +335,10 @@ namespace Svg
/// <value></value>
/// <value></value>
public
override
GraphicsPath
Path
(
SvgRenderer
renderer
)
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 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
))
var
isInvalidText
=
string
.
IsNullOrEmpty
(
Text
)
&&
!
Children
.
Any
(
x
=>
x
is
SvgTextSpan
);
return
_path
=
null
;
if
(
_path
==
null
||
IsPathDirty
||
isInvalidText
)
//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
)
{
{
renderer
=
(
renderer
??
SvgRenderer
.
FromNull
());
renderer
=
(
renderer
??
SvgRenderer
.
FromNull
());
// Measure the overall bounds of all the text
// Measure the overall bounds of all the text
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help