Skip to content

Commit

Permalink
LibVT: fix pixel size calculations in terminal_did_resize
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jcs authored and awesomekling committed Jan 1, 2020
1 parent ea1911b commit 275bc0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibVT/TerminalWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 275bc0d

Please sign in to comment.