mirror of https://github.com/mpv-player/mpv
console.lua: factor the bottom margin in line calculations
This is more important now that the margin is bigger due to the scaling with the window.
This commit is contained in:
parent
10789fae1f
commit
ce4a804a7d
|
@ -79,6 +79,7 @@ local line = ''
|
|||
local cursor = 1
|
||||
local default_prompt = '>'
|
||||
local prompt = default_prompt
|
||||
local bottom_left_margin = 6
|
||||
local default_id = 'default'
|
||||
local id = default_id
|
||||
local histories = {[id] = {}}
|
||||
|
@ -275,7 +276,7 @@ local function calculate_max_log_lines()
|
|||
select(2, mp.get_property('term-status-msg'):gsub('\\n', ''))
|
||||
end
|
||||
|
||||
return math.floor(select(2, get_scaled_osd_dimensions())
|
||||
return math.floor((select(2, get_scaled_osd_dimensions()) - bottom_left_margin)
|
||||
* (1 - global_margins.t - global_margins.b)
|
||||
/ opts.font_size
|
||||
-- Subtract 1 for the input line and 0.5 for the empty
|
||||
|
@ -513,8 +514,6 @@ local function update()
|
|||
|
||||
local screenx, screeny = get_scaled_osd_dimensions()
|
||||
|
||||
local bottom_left_margin = 6
|
||||
|
||||
local coordinate_top = math.floor(global_margins.t * screeny + 0.5)
|
||||
local clipping_coordinates = '0,' .. coordinate_top .. ',' ..
|
||||
screenx .. ',' .. screeny
|
||||
|
|
Loading…
Reference in New Issue