summaryrefslogtreecommitdiff
path: root/Libraries/LibVT
diff options
context:
space:
mode:
authorjoshua stein <jcs@jcs.org>2020-01-01 10:43:59 -0600
committerAndreas Kling <awesomekling@gmail.com>2020-01-01 19:33:19 +0100
commit275bc0d587dca7da4beed8c1abdd876ae9adfeba (patch)
tree830346ab92ab17f7d73e787ff9c8da3a9c65ae0f /Libraries/LibVT
parentea1911b5610b4fc88af7b7da91bce67bc33700ba (diff)
downloadserenity-275bc0d587dca7da4beed8c1abdd876ae9adfeba.zip
LibVT: fix pixel size calculations in terminal_did_resize
The scrollbar width must be factored in, and one too many m_line_spacing were being factored into the height. These caused an initial terminal opening in 80x25 to get resized right away and shrunk down to 77x24.
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r--Libraries/LibVT/TerminalWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp
index db3bce94b2..1cc426f193 100644
--- a/Libraries/LibVT/TerminalWidget.cpp
+++ b/Libraries/LibVT/TerminalWidget.cpp
@@ -611,8 +611,8 @@ void TerminalWidget::terminal_history_changed()
void TerminalWidget::terminal_did_resize(u16 columns, u16 rows)
{
- m_pixel_width = (frame_thickness() * 2) + (m_inset * 2) + (columns * font().glyph_width('x'));
- m_pixel_height = (frame_thickness() * 2) + (m_inset * 2) + (rows * (font().glyph_height() + m_line_spacing)) - m_line_spacing;
+ m_pixel_width = (frame_thickness() * 2) + (m_inset * 2) + (columns * font().glyph_width('x')) + m_scrollbar->width();
+ m_pixel_height = (frame_thickness() * 2) + (m_inset * 2) + (rows * (font().glyph_height() + m_line_spacing));
if (m_automatic_size_policy) {
set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);