From bd0d0befc01ca87700918822c306c3321318918d Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 21 Jan 2017 14:31:46 +0100 Subject: stats: put vsync ratio and jitter on the same line Free some vertical space. Hope this doesn't hurt visibility. --- player/lua/stats.lua | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 5d2e1d6a42..887411bffe 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -320,28 +320,23 @@ local function append_display_sync(s) {prefix="DS:" .. o.prefix_sep .. " - / ", prefix_sep=""}) end - -- Since no graph is needed we can print ratio/jitter on the same line and save some space - if not (o.plot_vsync_ratio or o.plot_vsync_jitter) then - local vratio = append_property(s, "vsync-ratio", {prefix="VSync Ratio:"}) - append_property(s, "vsync-jitter", {prefix="VSync Jitter:", nl=vratio and "" or o.nl}) - return - end - - -- As we potentially need to plot some graphs we print jitter and ratio on - -- their own lines so we have the same layout when toggled (= drawing graphs) - local ratio_graph = "" - local jitter_graph = "" - if o.ass_formatting and timer:is_enabled() then + -- As we need to plot some graphs we print jitter and ratio on their own lines + if timer:is_enabled() and (o.plot_vsync_ratio or o.plot_vsync_jitter) and o.ass_formatting then + local ratio_graph = "" + local jitter_graph = "" if o.plot_vsync_ratio then ratio_graph = generate_graph(vsratio_buf, vsratio_buf.pos, vsratio_buf.len, vsratio_buf.max, 0.8) end if o.plot_vsync_jitter then jitter_graph = generate_graph(vsjitter_buf, vsjitter_buf.pos, vsjitter_buf.len, vsjitter_buf.max, 0.8) end + append_property(s, "vsync-ratio", {prefix="VSync Ratio:", suffix=o.prefix_sep .. ratio_graph}) + append_property(s, "vsync-jitter", {prefix="VSync Jitter:", suffix=o.prefix_sep .. jitter_graph}) + else + -- Since no graph is needed we can print ratio/jitter on the same line and save some space + local vratio = append_property(s, "vsync-ratio", {prefix="VSync Ratio:"}) + append_property(s, "vsync-jitter", {prefix="VSync Jitter:", nl="" or o.nl}) end - - append_property(s, "vsync-ratio", {prefix="VSync Ratio:", suffix=o.prefix_sep .. ratio_graph}) - append_property(s, "vsync-jitter", {prefix="VSync Jitter:", suffix=o.prefix_sep .. jitter_graph}) end -- cgit v1.2.3