mirror of https://github.com/mpv-player/mpv
console.lua: use math.ceil in determine_hovered_item()
Replace the rounding to calculate the hovered line with ceil which is what you would expect to work. Rounding worked better before because it compensated for the errors fixed by the previous 2 commits.
This commit is contained in:
parent
ce4a804a7d
commit
b40241889b
|
@ -825,7 +825,7 @@ local function determine_hovered_item()
|
|||
-- Calculate how many lines could be printed without decreasing them for
|
||||
-- the input line and OSC.
|
||||
local max_lines = height / opts.font_size
|
||||
local clicked_line = math.floor(y / height * max_lines + .5)
|
||||
local clicked_line = math.ceil(y / height * max_lines)
|
||||
|
||||
local offset = first_match_to_print - 1
|
||||
local min_line = 1
|
||||
|
|
Loading…
Reference in New Issue