Skip to content

Commit

Permalink
console.lua: fix the clicked line calculation
Browse files Browse the repository at this point in the history
e00d8dc factored hidpi-scale in get_scaled_osd_dimensions(), so
max_lines was dividing by it a second time.
  • Loading branch information
guidocella authored and Dudemanguy committed Oct 27, 2024
1 parent 29cffad commit a210639
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions player/lua/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,7 @@ local function determine_hovered_item()
y = y - global_margins.t * height
-- Calculate how many lines could be printed without decreasing them for
-- the input line and OSC.
local max_lines = height / mp.get_property_native('display-hidpi-scale', 1)
/ opts.font_size
local max_lines = height / opts.font_size
local clicked_line = math.floor(y / height * max_lines + .5)

local offset = first_match_to_print - 1
Expand Down

0 comments on commit a210639

Please sign in to comment.