History

stats.lua: add add auto value to vidscale option

This adds auto to vidscale script option, which lets the scale be inherited from OSD --osd-scale-by-window option.

nanahi committed 2 years ago

Commit 1f29d031 parent 0c741993 files · +12 −2Browse files

Showing the changes to player/lua/stats.lua (1 of 3 files). Show all

Unified · Split

player/lua/stats.lua+9−2
@@ -60,7 +60,7 @@ local o = { · 59 unmodified lines
6060 shadow_y_offset = 0.0,
6161 shadow_color = "",
6262 alpha = "11",
63− vidscale = true,
63+ vidscale = "yes",
6464
6565 -- Custom header for ASS tags to style the text output.
6666 -- Specifying this will ignore the text style values above and just
@@ -1354,9 +1354,16 @@ local function print_page(page, after_scroll) · 1287 unmodified lines
13541354 end
13551355
13561356 local function update_scale(_, value)
1357+ local scale_with_video
1358+ if o.vidscale == "auto" then
1359+ scale_with_video = mp.get_property_native("osd-scale-by-window")
1360+ else
1361+ scale_with_video = o.vidscale == "yes"
1362+ end
1363+
13571364 -- Calculate scaled metrics.
13581365 local scale = 1
1359− if not o.vidscale and value > 0 then
1366+ if not scale_with_video and value > 0 then
13601367 scale = 720 / value
13611368 end
13621369 font_size = o.font_size * scale

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t