console.lua: factor OSC margins before the bottom margin

OSC margins are relative to the whole height before subtracting the
bottom left margin.
This commit is contained in:
Guido Cella 2024-10-30 15:57:37 +01:00 committed by Kacper Michajłow
parent 41cff490ad
commit e1680167fd
1 changed files with 3 additions and 2 deletions

View File

@ -276,8 +276,9 @@ 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()) - bottom_left_margin)
* (1 - global_margins.t - global_margins.b)
return math.floor((select(2, get_scaled_osd_dimensions())
* (1 - global_margins.t - global_margins.b)
- bottom_left_margin)
/ opts.font_size
-- Subtract 1 for the input line and 0.5 for the empty
-- line between the log and the input line.