From 158714554aef5088553f5bdf6d57d046c4909ddc Mon Sep 17 00:00:00 2001 From: paulushub Date: Tue, 13 Aug 2024 10:42:13 +0900 Subject: [PATCH] Fixes a color bug introduced in 1.8.4.1 - Fixed issue #291 --- Source/SharpVectorCss/Css/CssPrimitiveColorValue.cs | 4 ++-- Tests/SharpVectorsCore/Utils/PathUtilsTests.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/SharpVectorCss/Css/CssPrimitiveColorValue.cs b/Source/SharpVectorCss/Css/CssPrimitiveColorValue.cs index 1900afbb6..0d2a536c3 100644 --- a/Source/SharpVectorCss/Css/CssPrimitiveColorValue.cs +++ b/Source/SharpVectorCss/Css/CssPrimitiveColorValue.cs @@ -11,7 +11,7 @@ public CssPrimitiveColorValue(int color, bool readOnly) { SetFloatValue(0); } - else if (color > 0 && color <= 1) + else if (color > 0 && color < 1) { color = (int)(255 * color); SetFloatValue(color); @@ -58,7 +58,7 @@ protected override void OnSetCssText(string cssText) { color = 0; } - else if (color > 0 && color <= 1) + else if (color > 0 && color < 1) { color = (int)(255 * color); } diff --git a/Tests/SharpVectorsCore/Utils/PathUtilsTests.cs b/Tests/SharpVectorsCore/Utils/PathUtilsTests.cs index 321b25cd7..53241ce22 100644 --- a/Tests/SharpVectorsCore/Utils/PathUtilsTests.cs +++ b/Tests/SharpVectorsCore/Utils/PathUtilsTests.cs @@ -32,6 +32,8 @@ public sealed class PathUtilsTests "net6.0" #elif NET70 "net7.0" +#elif NET80 + "net8.0" #endif ; @@ -119,7 +121,7 @@ public void GetAssemblyFileName() } private string CombineInternal(params string[] paths) => - (string)_combineInternal.Invoke(null, new object[] { "", paths }); + _combineInternal.Invoke(null, new object[] { "", paths }) as string; private string GetAssemblyPathInternal(Assembly assembly) => (string)_getAssemblyPathInternal.Invoke(null, new object[] { assembly, "" });