diff options
author | ChrisK2 <spam@kalania.de> | 2013-10-26 03:50:11 +0200 |
---|---|---|
committer | ChrisK2 <spam@kalania.de> | 2013-10-26 03:50:11 +0200 |
commit | 3a181bac1ff0a84a9b09eb21093500210458f110 (patch) | |
tree | e333f481184a85d8e247649d3546e467194d8054 | |
parent | ecc0705f83aea409fcd14fbbab10af7b0675d275 (diff) | |
download | mpv-3a181bac1ff0a84a9b09eb21093500210458f110.tar.bz2 mpv-3a181bac1ff0a84a9b09eb21093500210458f110.tar.xz |
osc: make sure the OSC actually fits into the video
-rw-r--r-- | mpvcore/lua/osc.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua index 8166cd6896..4a3729c018 100644 --- a/mpvcore/lua/osc.lua +++ b/mpvcore/lua/osc.lua @@ -651,13 +651,19 @@ function osc_init() end - if user_opts.vidscale == true then + if user_opts.vidscale then osc_param.playresy = baseResY / scale else osc_param.playresy = display_h / scale end osc_param.playresx = osc_param.playresy * display_aspect + -- make sure the OSC actually fits into the video + if (osc_param.playresx < (osc_param.osc_w + (2 * osc_param.osc_p))) then + osc_param.playresy = (osc_param.osc_w + (2 * osc_param.osc_p)) / display_aspect + osc_param.playresx = osc_param.playresy * display_aspect + end + -- position of the controller according to video aspect and valignment osc_param.posX = math.floor(get_align(user_opts.halign, osc_param.playresx, osc_param.osc_w, 0)) osc_param.posY = math.floor(get_align(user_opts.valign, osc_param.playresy, osc_param.osc_h, 0)) |