Commit bd93be68 authored by Bigous's avatar Bigous
Browse files

BugFix: When an Text element was empty, with no text inside, an InvalidArgumentException rised.

parent cecce654
......@@ -91,7 +91,7 @@ namespace Svg
/// <summary>
/// Renders the <see cref="SvgElement"/> and contents to the specified <see cref="Graphics"/> object.
/// </summary>
/// <param name="graphics">The <see cref="SvgRenderer"/> object to render to.</param>
/// <param name="renderer">The <see cref="SvgRenderer"/> object to render to.</param>
protected override void Render(SvgRenderer renderer)
{
if (this.Path != null && this.Visible)
......
......@@ -98,7 +98,7 @@ namespace Svg
/// <summary>
/// Called by the underlying <see cref="SvgElement"/> when an element has been removed from the
/// <see cref="Children"/> collection.
/// <see cref="SvgElement.Children"/> collection.
/// </summary>
/// <param name="child">The <see cref="SvgElement"/> that has been removed.</param>
protected override void RemoveElement(SvgElement child)
......
......@@ -100,7 +100,7 @@ namespace Svg
}
/// <summary>
/// Gets a <see cref="ColourBlend"/> representing the <see cref="SvgGradientServer"/>'s gradient stops.
/// Gets a <see cref="ColorBlend"/> representing the <see cref="SvgGradientServer"/>'s gradient stops.
/// </summary>
/// <param name="owner">The parent <see cref="SvgVisualElement"/>.</param>
/// <param name="opacity">The opacity of the colour blend.</param>
......
......@@ -105,7 +105,7 @@ namespace Svg
/// <summary>
/// Gets a <see cref="Brush"/> representing the current paint server.
/// </summary>
/// <param name="styleOwner">The owner <see cref="SvgVisualElement"/>.</param>
/// <param name="renderingElement">The owner <see cref="SvgVisualElement"/>.</param>
/// <param name="opacity">The opacity of the brush.</param>
public override Brush GetBrush(SvgVisualElement renderingElement, float opacity)
{
......
......@@ -97,6 +97,7 @@ namespace Svg
/// Ensures that the specified ID is valid within the containing <see cref="SvgDocument"/>.
/// </summary>
/// <param name="id">A <see cref="string"/> containing the ID to validate.</param>
/// <param name="autoForceUniqueID">Creates a new unique id <see cref="string"/>.</param>
/// <exception cref="SvgException">
/// <para>The ID cannot start with a digit.</para>
/// <para>An element with the same ID already exists within the containing <see cref="SvgDocument"/>.</para>
......
......@@ -270,9 +270,10 @@ namespace Svg
get
{
// Make sure the path is always null if there is no text
//if (string.IsNullOrEmpty(this.Text))
// _path = null;
if (string.IsNullOrWhiteSpace(this.Text))
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)
{
......
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