mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +00:00
LibVT: Simplify TerminalWidget::widget_size_for_font()
Reuse the base size calculation from compute_base_size() instead of duplicating it.
This commit is contained in:
parent
ddc0c13007
commit
c3018f8beb
1 changed files with 3 additions and 2 deletions
|
@ -1247,9 +1247,10 @@ Gfx::IntSize TerminalWidget::widget_size_for_font(Gfx::Font const& font) const
|
|||
int cell_height = 0;
|
||||
int line_spacing = 0;
|
||||
collect_font_metrics(font, column_width, cell_height, line_height, line_spacing);
|
||||
auto base_size = compute_base_size();
|
||||
return {
|
||||
(frame_thickness() * 2) + (m_inset * 2) + (m_terminal.columns() * column_width) + m_scrollbar->width(),
|
||||
(frame_thickness() * 2) + (m_inset * 2) + (m_terminal.rows() * line_height)
|
||||
base_size.width() + (m_terminal.columns() * column_width),
|
||||
base_size.height() + (m_terminal.rows() * line_height),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue