From f03cee6b6e1c200cc82f54abd3bb605fe079bf83 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Tue, 27 Jun 2023 18:00:53 -0700 Subject: [PATCH] reccmp: improve progress bar text rendering --- tools/reccmp/reccmp.py | 2 +- tools/reccmp/template.svg | 40 ++++++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/tools/reccmp/reccmp.py b/tools/reccmp/reccmp.py index 3368bb72..a8d3cd07 100755 --- a/tools/reccmp/reccmp.py +++ b/tools/reccmp/reccmp.py @@ -429,7 +429,7 @@ def gen_svg(svg, name, icon, implemented_funcs, total_funcs, raw_accuracy): templatedata = templatedata[0:percentstart] + str(progwidth) + templatedata[percentend + 1:] # Replace percentage statistic - templatedata = templatedata.replace('{percent}', '%.2f%%' % (total_statistic * 100), 1) + templatedata = templatedata.replace('{percent}', '%.2f%%' % (total_statistic * 100), 2) svgfile = open(svg, 'w') if not svgfile: diff --git a/tools/reccmp/template.svg b/tools/reccmp/template.svg index 6f7fac79..091d721d 100644 --- a/tools/reccmp/template.svg +++ b/tools/reccmp/template.svg @@ -10,13 +10,12 @@ xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> + + + + {percent}{percent}