From 3a181bac1ff0a84a9b09eb21093500210458f110 Mon Sep 17 00:00:00 2001 From: ChrisK2 Date: Sat, 26 Oct 2013 03:50:11 +0200 Subject: osc: make sure the OSC actually fits into the video --- mpvcore/lua/osc.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3