소스 검색

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.
Andreas Kling 2 년 전
부모
커밋
b4946eac6e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibVT/TerminalWidget.cpp

+ 1 - 1
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.