From 39dfc1ed28571b520a035333ed04ed872ed73abf Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Wed, 10 Apr 2024 19:21:51 +0200 Subject: [PATCH] fixed S19 icons --- icons/s-19-negative.svg | 2 +- icons/s-19.svg | 2 +- s_generator.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/icons/s-19-negative.svg b/icons/s-19-negative.svg index eb57687..45e1e21 100644 --- a/icons/s-19-negative.svg +++ b/icons/s-19-negative.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/icons/s-19.svg b/icons/s-19.svg index 3ded6ad..16acab3 100644 --- a/icons/s-19.svg +++ b/icons/s-19.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/s_generator.py b/s_generator.py index 5f2f9d8..e79d9c7 100644 --- a/s_generator.py +++ b/s_generator.py @@ -41,6 +41,16 @@ def convert_svg(sn_svg): x = float(digit.group(1)) x -= WIDTH path = path[:pos[0]+1] + str(x) + path[pos[0] + len(digit.group(1)):] + + digits = list(re.finditer("A(.*? .*? .*? .*? .*? \d+(\.\d+)?)", path))[::-1] + + for digit in digits: + pos = digit.span() + s, d = digit.group(1).rsplit(" ", 1) + x = float(d) + x -= WIDTH + d = s + " " + str(x) + path = path[:pos[0]+1] + d + path[pos[0] + len(digit.group(1)):] path = S + "Z" + path sn_svg = sn_svg[:path_pos[0]] + path + sn_svg[path_pos[1]:]