stats.lua: fix page 2 alignment of "Total"

The text didn't line up with with the percentages above it because it
didn't use a monospace font.

Instead insert the text at the same position in the template as the
percentages and convert one o.prefix_sep from the percentages into hard
coded \h\h to ensure alignment even when the user changes o.prefix_sep.
This commit is contained in:
Christoph Heinrich 2023-10-14 02:26:20 +02:00 committed by Dudemanguy
parent 78d43740f5
commit 4a88e3d5c0
1 changed files with 3 additions and 3 deletions

View File

@ -351,7 +351,7 @@ local function append_perfdata(s, dedicated_page, print_passes)
s[#s+1] = format(f, o.nl, o.indent, o.indent,
o.font_mono, pp(pass["last"]),
pp(pass["avg"]), pp(pass["peak"]),
o.prefix_sep .. o.prefix_sep, p(pass["last"], last_s[frame]),
o.prefix_sep .. "\\h\\h", p(pass["last"], last_s[frame]),
o.font, o.prefix_sep, o.prefix_sep, pass["desc"])
if o.plot_perfdata and o.use_ass then
@ -366,8 +366,8 @@ local function append_perfdata(s, dedicated_page, print_passes)
-- Print sum of timing values as "Total"
s[#s+1] = format(f, o.nl, o.indent, o.indent,
o.font_mono, pp(last_s[frame]),
pp(avg_s[frame]), pp(peak_s[frame]), "", "", o.font,
o.prefix_sep, o.prefix_sep, b("Total"))
pp(avg_s[frame]), pp(peak_s[frame]),
o.prefix_sep, b("Total"), o.font, "", "", "")
else
-- for the simplified view, we just print the sum of each pass
s[#s+1] = format(f, o.nl, o.indent, o.indent, o.font_mono,