History

stats.lua: handle osd-scale-by-window runtime update

Allows the scale mode to be changed at runtime if vidscale is set to auto.

nanahi committed 2 years ago

Commit de371a51 parent 85b3a6e1 file · +12 −2Browse files

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

Unified · Split

player/lua/stats.lua+12−2
@@ -1353,7 +1353,7 @@ local function print_page(page, after_scroll) · 1352 unmodified lines
13531353 end
13541354 end
13551355
1356−local function update_scale(_, value)
1356+local function update_scale(value)
13571357 local scale_with_video
13581358 if o.vidscale == "auto" then
13591359 scale_with_video = mp.get_property_native("osd-scale-by-window")
@@ -1376,6 +1376,15 @@ local function update_scale(_, value) · 16 unmodified lines
13761376 end
13771377 end
13781378
1379+local function handle_osd_height_update(_, value)
1380+ update_scale(value)
1381+end
1382+
1383+local function handle_osd_scale_by_window_update()
1384+ local value = mp.get_property_native("osd-height")
1385+ update_scale(value)
1386+end
1387+
13791388 local function clear_screen()
13801389 if o.persistent_overlay then mp.set_osd_ass(0, 0, "") else mp.osd_message("", 0) end
13811390 end
@@ -1604,4 +1613,5 @@ if o.bindlist ~= "no" then · 222 unmodified lines
16041613 end)
16051614 end
16061615
1607−mp.observe_property('osd-height', 'native', update_scale)
1616+mp.observe_property('osd-height', 'native', handle_osd_height_update)
1617+mp.observe_property('osd-scale-by-window', 'native', handle_osd_scale_by_window_update)

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