arc flag parse fix + another icon set
This commit is contained in:
parent
987531b018
commit
ca023c1a08
|
@ -124,6 +124,9 @@ proc parsePath*(path: string): Path =
|
|||
|
||||
armed = true
|
||||
|
||||
template expectsArcFlag(): bool =
|
||||
kind in {Arc, RArc} and numbers.len mod 7 in {3, 4}
|
||||
|
||||
while p < path.len:
|
||||
case path[p]:
|
||||
# Relative
|
||||
|
@ -195,7 +198,7 @@ proc parsePath*(path: string): Path =
|
|||
finishNumber()
|
||||
numberStart = p
|
||||
of '.':
|
||||
if hitDecimal:
|
||||
if hitDecimal or expectsArcFlag():
|
||||
finishNumber()
|
||||
hitDecimal = true
|
||||
if numberStart == 0:
|
||||
|
@ -203,6 +206,8 @@ proc parsePath*(path: string): Path =
|
|||
of ' ', ',', '\r', '\n', '\t':
|
||||
finishNumber()
|
||||
else:
|
||||
if numberStart > 0 and expectsArcFlag():
|
||||
finishNumber()
|
||||
if p - 1 == numberStart and path[p - 1] == '0':
|
||||
# If the number starts with 0 and we've hit another digit, finish the 0
|
||||
# .. 01.3.. -> [..0, 1.3..]
|
||||
|
|
BIN
tests/images/svg/simple-icons.png
Normal file
BIN
tests/images/svg/simple-icons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
|
@ -25,7 +25,7 @@ const
|
|||
IconSet(name: "flat-color-icons", path: "../flat-color-icons/svg/*"),
|
||||
IconSet(name: "ionicons", path: "../ionicons/src/svg/*"),
|
||||
# IconSet(name: "tabler-icons", path: "../tabler-icons/icons/*"),
|
||||
# IconSet(name: "simple-icons", path: "../simple-icons/icons/*")
|
||||
IconSet(name: "simple-icons", path: "../simple-icons/icons/*")
|
||||
]
|
||||
width = 32
|
||||
height = 32
|
||||
|
|
Loading…
Reference in a new issue