mirror of
https://github.com/mpv-player/mpv
synced 2025-01-14 02:51:26 +00:00
osc: scale rendered aspect ratio with window aspect ratio
The logo stays centered better and it doesn't distort anymore due to a recent change in libass https://github.com/libass/libass/pull/645
This commit is contained in:
parent
d2a0791fe8
commit
cc65b3892d
@ -2585,7 +2585,11 @@ function tick()
|
||||
|
||||
-- render idle message
|
||||
msg.trace("idle message")
|
||||
local icon_x, icon_y = 320 - 26, 140
|
||||
local _, _, display_aspect = mp.get_osd_size()
|
||||
local display_h = 360
|
||||
local display_w = display_h * display_aspect
|
||||
-- logo is rendered at 2^(6-1) = 32 times resolution with size 1800x1800
|
||||
local icon_x, icon_y = (display_w - 1800 / 32) / 2, 140
|
||||
local line_prefix = ("{\\rDefault\\an7\\1a&H00&\\bord0\\shad0\\pos(%f,%f)}"):format(icon_x, icon_y)
|
||||
|
||||
local ass = assdraw.ass_new()
|
||||
@ -2607,11 +2611,11 @@ function tick()
|
||||
|
||||
if user_opts.idlescreen then
|
||||
ass:new_event()
|
||||
ass:pos(320, icon_y+65)
|
||||
ass:pos(display_w / 2, icon_y + 65)
|
||||
ass:an(8)
|
||||
ass:append("Drop files or URLs to play here.")
|
||||
end
|
||||
set_osd(640, 360, ass.text)
|
||||
set_osd(display_w, display_h, ass.text)
|
||||
|
||||
if state.showhide_enabled then
|
||||
mp.disable_key_bindings("showhide")
|
||||
|
Loading…
Reference in New Issue
Block a user