summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-04-15 00:45:18 -0400
committerKacper Michajłow <kasper93@gmail.com>2024-04-18 18:44:53 +0200
commitd28368893948239481387034db7ac9ee9f25a244 (patch)
tree200156d58a45c0c2964984f5172c59893f767b6b
parent5370923a350eaf18e778e28d3ea9d023b4e8468a (diff)
downloadmpv-d28368893948239481387034db7ac9ee9f25a244.tar.bz2
mpv-d28368893948239481387034db7ac9ee9f25a244.tar.xz
stats.lua: add option to control plot border width
This adds a new configuration option plot_bg_border_width, which controls the border width of plots.
-rw-r--r--DOCS/man/stats.rst5
-rw-r--r--player/lua/stats.lua5
2 files changed, 8 insertions, 2 deletions
diff --git a/DOCS/man/stats.rst b/DOCS/man/stats.rst
index a5cd3b3d91..be8bb50e6b 100644
--- a/DOCS/man/stats.rst
+++ b/DOCS/man/stats.rst
@@ -183,6 +183,11 @@ Configurable Options
Border color used for drawing graphs.
+``plot_bg_border_width``
+ Default: 0.5
+
+ Border width used for drawing graphs.
+
``plot_bg_color``
Default: 262626
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index 161e1fd739..76d50e0eff 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -47,6 +47,7 @@ local o = {
plot_bg_border_color = "0000FF",
plot_bg_color = "262626",
plot_color = "FFFFFF",
+ plot_bg_border_width = 0.5,
-- Text style
font = "",
@@ -235,8 +236,8 @@ local function generate_graph(values, i, len, v_max, v_avg, scale, x_tics)
s[#s+1] = format("%f %f %f %f", x, y_max, 0, y_max)
- local bg_box = format("{\\bord0.5}{\\3c&H%s&}{\\1c&H%s&}m 0 %f l %f %f %f 0 0 0",
- o.plot_bg_border_color, o.plot_bg_color, y_max, x_max, y_max, x_max)
+ local bg_box = format("{\\bord%f}{\\3c&H%s&}{\\1c&H%s&}m 0 %f l %f %f %f 0 0 0",
+ o.plot_bg_border_width, o.plot_bg_border_color, o.plot_bg_color, y_max, x_max, y_max, x_max)
return format("%s{\\rDefault}{\\pbo%f}{\\shad0}{\\alpha&H00}{\\p1}%s{\\p0}{\\bord0}{\\1c&H%s}{\\p1}%s{\\p0}%s",
o.prefix_sep, y_offset, bg_box, o.plot_color, table.concat(s), text_style())
end