Skip to content

Commit

Permalink
tools/svg2tvgt: handle scientific notation in float
Browse files Browse the repository at this point in the history
This updates the svg2tvgt to handle scientific notation in
floating-point values, which can exist, apparently. ;)
  • Loading branch information
vancluever authored and ikskuh committed Dec 26, 2023
1 parent 1b5f1f1 commit b8e82bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tools/svg2tvgt/svg2tvgt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2192,20 +2192,20 @@ float ParseNumberGeneric(bool allow_sign)
{
while (true)
{
c = PeekAny("0123456789.");
c = PeekAny("0123456789.eE+-");
if (c == null)
return ParseFloat(begin.Slice());
AcceptChar("0123456789.");
AcceptChar("0123456789.eE+-");
if (c.Value == '.')
break;
}
}
while (true)
{
c = PeekAny("0123456789");
c = PeekAny("0123456789eE+-");
if (c == null)
return ParseFloat(begin.Slice());
AcceptChar("0123456789");
AcceptChar("0123456789eE+-");
}
}

Expand Down

0 comments on commit b8e82bc

Please sign in to comment.