From affee03dc5dace843109a83211be150a0bcdda75 Mon Sep 17 00:00:00 2001 From: Utkarsh khambra Date: Sat, 25 Feb 2023 17:45:22 +0530 Subject: [PATCH] refactor to use statusLineHeight(). --- src/vtbackend/Terminal.cpp | 15 +++------------ src/vtrasterizer/Renderer.cpp | 4 +--- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/vtbackend/Terminal.cpp b/src/vtbackend/Terminal.cpp index 43df9b13c6..b45ac3cbad 100644 --- a/src/vtbackend/Terminal.cpp +++ b/src/vtbackend/Terminal.cpp @@ -1056,10 +1056,7 @@ void Terminal::resizeScreenInternal(PageSize totalPageSize, std::optional(mainDisplayPageSize.lines) - 1 }, @@ -1761,10 +1755,7 @@ void Terminal::applyPageSizeToCurrentBuffer() void Terminal::applyPageSizeToMainDisplay(ScreenType screenType) { - auto const statusLineHeight = LineCount(1); - auto const mainDisplayPageSize = _state.statusDisplayType == StatusDisplayType::None - ? _settings.pageSize - : _settings.pageSize - statusLineHeight; + auto const mainDisplayPageSize = _settings.pageSize - statusLineHeight(); // clang-format off switch (screenType) diff --git a/src/vtrasterizer/Renderer.cpp b/src/vtrasterizer/Renderer.cpp index 696d42277b..ad1e9d4967 100644 --- a/src/vtrasterizer/Renderer.cpp +++ b/src/vtrasterizer/Renderer.cpp @@ -293,9 +293,7 @@ void Renderer::updateFontMetrics() void Renderer::render(Terminal& terminal, bool pressure) { - auto const statusLineHeight = terminal.state().statusDisplayType == StatusDisplayType::None - ? LineCount(0) - : terminal.hostWritableStatusLineDisplay().pageSize().lines; + auto const statusLineHeight = terminal.statusLineHeight(); _gridMetrics.pageSize = terminal.pageSize() + statusLineHeight; executeImageDiscards();