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
60 shadow_y_offset = 0.0,60 shadow_y_offset = 0.0,
61 shadow_color = "",61 shadow_color = "",
62 alpha = "11",62 alpha = "11",
63 vidscale = true,63 vidscale = "yes",
64 64
65 -- Custom header for ASS tags to style the text output.65 -- Custom header for ASS tags to style the text output.
66 -- Specifying this will ignore the text style values above and just66 -- 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
1354end1354end
1355 1355
1356local function update_scale(_, value)1356local 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
1357 -- Calculate scaled metrics.1364 -- Calculate scaled metrics.
1358 local scale = 11365 local scale = 1
1359 if not o.vidscale and value > 0 then1366 if not scale_with_video and value > 0 then
1360 scale = 720 / value1367 scale = 720 / value
1361 end1368 end
1362 font_size = o.font_size * scale1369 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