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