From 4a88e3d5c07d1c06595b724a1a98c5a212d81ab4 Mon Sep 17 00:00:00 2001 From: Christoph Heinrich Date: Sat, 14 Oct 2023 02:26:20 +0200 Subject: [PATCH] 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. --- player/lua/stats.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/player/lua/stats.lua b/player/lua/stats.lua index fc3f8b8121..2877361bae 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -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,