mirror of https://github.com/mpv-player/mpv
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:
parent
78d43740f5
commit
4a88e3d5c0
|
@ -351,7 +351,7 @@ local function append_perfdata(s, dedicated_page, print_passes)
|
||||||
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
||||||
o.font_mono, pp(pass["last"]),
|
o.font_mono, pp(pass["last"]),
|
||||||
pp(pass["avg"]), pp(pass["peak"]),
|
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"])
|
o.font, o.prefix_sep, o.prefix_sep, pass["desc"])
|
||||||
|
|
||||||
if o.plot_perfdata and o.use_ass then
|
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"
|
-- Print sum of timing values as "Total"
|
||||||
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
||||||
o.font_mono, pp(last_s[frame]),
|
o.font_mono, pp(last_s[frame]),
|
||||||
pp(avg_s[frame]), pp(peak_s[frame]), "", "", o.font,
|
pp(avg_s[frame]), pp(peak_s[frame]),
|
||||||
o.prefix_sep, o.prefix_sep, b("Total"))
|
o.prefix_sep, b("Total"), o.font, "", "", "")
|
||||||
else
|
else
|
||||||
-- for the simplified view, we just print the sum of each pass
|
-- 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,
|
s[#s+1] = format(f, o.nl, o.indent, o.indent, o.font_mono,
|
||||||
|
|
Loading…
Reference in New Issue