Commit cc4f2940 authored by Ritch Melton's avatar Ritch Melton
Browse files

Removed Trim() condition to allow for whitespace strings

parent d9e96ccf
...@@ -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 path is always null if there is no text //When an empty string is passed to GraphicsPath, it 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment