mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:17:44 +00:00
HexEditor: Size the offset area based on the text width
This gets rid of the last use of the offset_margin_width() magic number. I initially tried using `character_width() * 10` and found it was not accurate enough with between-character spacing, so instead this measures a specific string. All offset strings should be the same width in a fixed-width font.
This commit is contained in:
parent
0fdbdc5084
commit
3318563ad9
1 changed files with 1 additions and 2 deletions
|
@ -110,9 +110,8 @@ private:
|
|||
size_t line_height() const { return font().pixel_size_rounded_up() + m_line_spacing; }
|
||||
size_t character_width() const { return font().glyph_fixed_width(); }
|
||||
size_t cell_width() const { return character_width() * 3; }
|
||||
size_t offset_margin_width() const { return 80; }
|
||||
|
||||
int offset_area_width() const { return offset_margin_width() + m_padding; }
|
||||
int offset_area_width() const { return m_padding + font().width_rounded_up("0X12345678"sv) + m_padding; }
|
||||
int hex_area_width() const { return m_padding + m_bytes_per_row * cell_width() + m_padding; }
|
||||
int text_area_width() const { return m_padding + m_bytes_per_row * character_width() + m_padding; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue