mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:57:46 +00:00
LibVT: Compute the font metrics once and cache them
The height of a line or column doesn't change unless the font changes, and we were already caching the line height. This patch extends it so we also cache the column width.
This commit is contained in:
parent
b4946eac6e
commit
2e1b8b90f4
2 changed files with 29 additions and 10 deletions
|
@ -161,6 +161,8 @@ private:
|
|||
VT::Position next_position_after(const VT::Position&, bool should_wrap) const;
|
||||
VT::Position previous_position_before(const VT::Position&, bool should_wrap) const;
|
||||
|
||||
void update_cached_font_metrics();
|
||||
|
||||
VT::Terminal m_terminal;
|
||||
|
||||
VT::Range m_selection;
|
||||
|
@ -191,6 +193,7 @@ private:
|
|||
int m_inset { 2 };
|
||||
int m_line_spacing { 4 };
|
||||
int m_line_height { 0 };
|
||||
int m_column_width { 0 };
|
||||
|
||||
int m_ptm_fd { -1 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue