summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-12-22 12:50:29 +0100
committerwm4 <wm4@nowhere>2019-12-22 12:50:29 +0100
commitb8995048628cd3701d0669da305a3bcf28b2d4bf (patch)
tree9bcd182003a2ec9e59b0532cdec236b803016e35 /player/lua
parent6bf1a830574e84012c44920584fd72f7ad9a55af (diff)
downloadmpv-b8995048628cd3701d0669da305a3bcf28b2d4bf.tar.bz2
mpv-b8995048628cd3701d0669da305a3bcf28b2d4bf.tar.xz
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.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/osc.lua11
1 files changed, 5 insertions, 6 deletions
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