From b77562e7b4bae085f1beaa428b6038e80bbfc562 Mon Sep 17 00:00:00 2001 From: H1Gdev Date: Fri, 20 Sep 2019 17:23:31 +0900 Subject: [PATCH] Fix: SvgColourServer ToString method. --- Source/Painting/SvgColourServer.cs | 2 +- Source/Painting/SvgPaintServerFactory.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Painting/SvgColourServer.cs b/Source/Painting/SvgColourServer.cs index 5d54e0d..5584d98 100644 --- a/Source/Painting/SvgColourServer.cs +++ b/Source/Painting/SvgColourServer.cs @@ -53,7 +53,7 @@ namespace Svg return c.Name; #endif // Return the hex value - return String.Format("#{0}", c.ToArgb().ToString("x").Substring(2)); + return String.Format("#{0}", c.ToArgb().ToString("x8").Substring(2)); } public override SvgElement DeepCopy() diff --git a/Source/Painting/SvgPaintServerFactory.cs b/Source/Painting/SvgPaintServerFactory.cs index c8c3d73..88f3fe9 100644 --- a/Source/Painting/SvgPaintServerFactory.cs +++ b/Source/Painting/SvgPaintServerFactory.cs @@ -81,10 +81,9 @@ namespace Svg { if (destinationType == typeof(string)) { - // check for none - if (value == SvgPaintServer.None) return "none"; - if (value == SvgPaintServer.Inherit) return "inherit"; - if (value == SvgPaintServer.NotSet) return string.Empty; + // check for constant + if (value == SvgPaintServer.None || value == SvgPaintServer.Inherit || value == SvgPaintServer.NotSet) + return value.ToString(); #if !NETSTANDARD20 var colourServer = value as SvgColourServer; if (colourServer != null)