diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 2d16457..d626610 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -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..] diff --git a/tests/images/svg/simple-icons.png b/tests/images/svg/simple-icons.png new file mode 100644 index 0000000..20775e6 Binary files /dev/null and b/tests/images/svg/simple-icons.png differ diff --git a/tests/megatest.nim b/tests/megatest.nim index b0ec4f8..992140d 100644 --- a/tests/megatest.nim +++ b/tests/megatest.nim @@ -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