Skip to content

Commit

Permalink
stats.lua: rename a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
guidocella committed Oct 12, 2024
1 parent 6fadaf6 commit d52c45b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions player/lua/stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ local function print_page(page, after_scroll)
end
end

local function update_scale(value)
local function update_scale(height)
local scale_with_video
if o.vidscale == "auto" then
scale_with_video = mp.get_property_native("osd-scale-by-window")
Expand All @@ -1535,8 +1535,8 @@ local function update_scale(value)

-- Calculate scaled metrics.
local scale = 1
if not scale_with_video and value > 0 then
scale = 720 / value
if not scale_with_video and height > 0 then
scale = 720 / height
end
font_size = o.font_size * scale
border_size = o.border_size * scale
Expand All @@ -1548,13 +1548,12 @@ local function update_scale(value)
end
end

local function handle_osd_height_update(_, value)
update_scale(value)
local function handle_osd_height_update(_, height)
update_scale(height)
end

local function handle_osd_scale_by_window_update()
local value = mp.get_property_native("osd-height")
update_scale(value)
update_scale(mp.get_property_native("osd-height"))
end

local function clear_screen()
Expand Down

0 comments on commit d52c45b

Please sign in to comment.