mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 15:48:09 -05:00
reccmp: improve progress bar text rendering
This commit is contained in:
parent
40fdc5b2f5
commit
f03cee6b6e
2 changed files with 26 additions and 16 deletions
|
@ -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:
|
||||
|
|
|
@ -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"><defs
|
||||
id="defs2"><rect
|
||||
x="79.651809"
|
||||
y="538.62568"
|
||||
width="480.69626"
|
||||
height="32.696293"
|
||||
id="rect1277" /></defs><rect x="0" y="0" width="100%" height="100%" fill="#0d1117" /><g
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs>
|
||||
<clipPath id="progBarCutoff">
|
||||
<rect width="{progbar:127.18422}" height="8.6508904" x="21.074554" y="134.86963" />
|
||||
</clipPath>
|
||||
</defs><rect
|
||||
x="0" y="0" width="100%" height="100%" fill="#0d1117" /><g
|
||||
id="g1273"
|
||||
transform="translate(-3.9577451e-7,-0.93505135)"><image
|
||||
width="84.666664"
|
||||
|
@ -43,19 +42,30 @@
|
|||
width="127.18422"
|
||||
height="8.6508904"
|
||||
x="21.074554"
|
||||
y="134.86963" /><rect
|
||||
style="display:inline;fill:#ffffff;stroke:none;stroke-width:2.6764"
|
||||
id="rect1169"
|
||||
width="{progbar:127.18422}"
|
||||
height="8.6508904"
|
||||
x="21.074554"
|
||||
y="134.86963" /><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#c0c0c0;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:white;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
|
||||
x="76.841347"
|
||||
y="140.70638"
|
||||
id="text2152"><tspan
|
||||
style="font-size:4.23333px;fill:#c0c0c0;fill-opacity:1;stroke-width:1.05833"
|
||||
style="font-size:4.23333px;fill:white;fill-opacity:1;stroke-width:1.05833"
|
||||
x="76.841347"
|
||||
y="140.70638"
|
||||
id="tspan2150">{percent}</tspan></text><rect
|
||||
style="display:inline;fill:#ffffff;stroke:none;stroke-width:2.6764"
|
||||
id="rect1169"
|
||||
width="127.18422"
|
||||
height="8.6508904"
|
||||
x="21.074554"
|
||||
y="134.86963"
|
||||
clip-path="url(#progBarCutoff)" /><text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
|
||||
x="76.841347"
|
||||
y="140.70638"
|
||||
id="text2152"
|
||||
clip-path="url(#progBarCutoff)"><tspan
|
||||
style="font-size:4.23333px;fill:black;fill-opacity:1;stroke-width:1.05833"
|
||||
x="76.841347"
|
||||
y="140.70638"
|
||||
id="tspan2150">{percent}</tspan></text></g><text
|
||||
|
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 4 KiB |
Loading…
Reference in a new issue