From b4946eac6e4adb23e4c92686edb94e18a1c3cacd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 3 Jan 2023 18:40:26 +0100 Subject: [PATCH] LibVT: Fix bug where terminal size got lost on font size change When changing the font size, we now resize the terminal widget *before* setting the font. This ensures that we keep the same logical terminal size after the font change. --- Userland/Libraries/LibVT/TerminalWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index 83a337fe9a..4ef4b8f06f 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -1260,8 +1260,8 @@ constexpr Gfx::Color TerminalWidget::terminal_color_to_rgb(VT::Color color) cons void TerminalWidget::set_font_and_resize_to_fit(Gfx::Font const& font) { - set_font(font); resize(widget_size_for_font(font)); + set_font(font); } // Used for sending data that was not directly typed by the user.