From b8995048628cd3701d0669da305a3bcf28b2d4bf Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 22 Dec 2019 12:50:29 +0100 Subject: osc: use video margins only if OSC is visible Looks awkward otherwise. This means that even if boxvideo is enabled, nothing gets "boxed" if the OSC is set to auto-hide. --- player/lua/osc.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'player/lua') diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 8196574372..8f694e8e06 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2051,6 +2051,11 @@ end function update_margins() local margins = osc_param.video_margins + -- Don't use margins if it's visible only temporarily. + if (not state.osc_visible) or (get_hidetimeout() >= 0) then + margins = {l = 0, r = 0, t = 0, b = 0} + end + if user_opts.boxvideo then -- check whether any margin option has a non-default value local margins_used = false @@ -2076,12 +2081,6 @@ function update_margins() reset_margins() end - -- Don't report margins if it's visible only temporarily. At least for - -- console.lua this makes no sense. - if (not state.osc_visible) or (get_hidetimeout() >= 0) then - margins = {l = 0, r = 0, t = 0, b = 0} - end - utils.shared_script_property_set("osc-margins", string.format("%f,%f,%f,%f", margins.l, margins.r, margins.t, margins.b)) end -- cgit v1.2.3