From 5e65999eb26b92bb10aa1ed2f88a633f77442e25 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Wed, 15 May 2024 20:57:39 +0200 Subject: [PATCH] console.lua: fix the max log lines calculation --- player/lua/console.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/player/lua/console.lua b/player/lua/console.lua index 43ec0521cf..c26525f9f6 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -251,13 +251,14 @@ local function calculate_max_log_lines() select(2, mp.get_property('term-status-msg'):gsub('\\n', '')) end - -- Subtract 1.5 to account for the input line. return math.floor(mp.get_property_native('osd-height') / mp.get_property_native('display-hidpi-scale', 1) / opts.scale * (1 - global_margins.t - global_margins.b) / opts.font_size - - 1.5) + -- Subtract 1 for the input line and 1 for the newline + -- between the log and the input line. + - 2) end -- Takes a list of strings, a max width in characters and