History

console.lua: fix the clicked line calculation

e00d8dcb03 factored hidpi-scale in get_scaled_osd_dimensions(), so max_lines was dividing by it a second time.

Guido Cella committed 2 years ago

Commit a2106391 parent 29cffad1 file · +1 −2Browse files

Showing the changes to player/lua/console.lua (1 of 1 file). Show all

Unified · Split

player/lua/console.lua+1−2
@@ -814,8 +814,7 @@ local function determine_hovered_item() · 813 unmodified lines
814814 y = y - global_margins.t * height
815815 -- Calculate how many lines could be printed without decreasing them for
816816 -- the input line and OSC.
817− local max_lines = height / mp.get_property_native('display-hidpi-scale', 1)
818− / opts.font_size
817+ local max_lines = height / opts.font_size
819818 local clicked_line = math.floor(y / height * max_lines + .5)
820819
821820 local offset = first_match_to_print - 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t