mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
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.
This commit is contained in:
parent
ea1911b561
commit
275bc0d587
Notes:
sideshowbarker
2024-07-19 10:28:29 +09:00
Author: https://github.com/jcs Commit: https://github.com/SerenityOS/serenity/commit/275bc0d587d Pull-request: https://github.com/SerenityOS/serenity/pull/986
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user