summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2023-10-14 02:26:20 +0200
committerDudemanguy <random342@airmail.cc>2023-10-15 13:39:46 +0000
commit4a88e3d5c07d1c06595b724a1a98c5a212d81ab4 (patch)
treeb94777fcdd9c5a050e5909b06973f611f6e56513
parent78d43740f52db817d98bcf24fb30a76ab6fa13ff (diff)
downloadmpv-4a88e3d5c07d1c06595b724a1a98c5a212d81ab4.tar.bz2
mpv-4a88e3d5c07d1c06595b724a1a98c5a212d81ab4.tar.xz
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.
-rw-r--r--player/lua/stats.lua6
1 files 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,