Skip to content

Commit 597b895

Browse files
committed
Made decent progress on resolving the acid example
1 parent 45813e2 commit 597b895

File tree

11 files changed

+610
-45
lines changed

11 files changed

+610
-45
lines changed

Samples/Example/Example.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<ProjectReference Include="..\..\Source\SVGImage\DotNetProjects.SVGImage.csproj" />
4444
</ItemGroup>
4545
<ItemGroup>
46+
<Resource Include="Images\acid1_TextOnly.svg" />
4647
<Resource Include="Images\brush.svg" />
4748
<Resource Include="Images\error.svg" />
4849
<Resource Include="Images\example radgrad01.svg" />
Lines changed: 160 additions & 0 deletions
Loading

Source/SVGImage/SVG/Shapes/LengthPercentageOrNumber.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace SVGImage.SVG.Shapes
66

77
public struct LengthPercentageOrNumber
88
{
9-
private static readonly Regex _lengthRegex = new Regex(@"(?<Value>\d+(?:\.\d+)?)\s*(?<Unit>%|\w+)?", RegexOptions.Compiled | RegexOptions.Singleline);
9+
private static readonly Regex _lengthRegex = new Regex(@"(?<Value>-?\d+(?:\.\d+)?)\s*(?<Unit>%|\w+)?", RegexOptions.Compiled | RegexOptions.Singleline);
1010
private readonly LengthContext _context;
1111
private readonly double _value;
1212
/// <summary>
@@ -180,12 +180,12 @@ public static LengthPercentageOrNumber Parse(Shape owner, string value, LengthOr
180180
}
181181
else
182182
{
183-
// Default to pixels if no unit is specified
184-
context = new LengthContext(owner, LengthUnit.px);
183+
// Default to Number if no unit is specified
184+
context = new LengthContext(owner, LengthUnit.Number);
185185
}
186186
return new LengthPercentageOrNumber(d, context);
187187
}
188-
188+
189189
}
190190

191191

0 commit comments

Comments
 (0)