1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:24:59 +00:00

TextEditor: Increase padding in ruler width

This commit is contained in:
Itamar 2020-08-21 10:58:05 +03:00 committed by Andreas Kling
parent f5aa0988f5
commit ebab512c03

View file

@ -330,7 +330,8 @@ int TextEditor::ruler_width() const
if (!m_ruler_visible)
return 0;
int line_count_digits = static_cast<int>(log10(line_count())) + 1;
return line_count() < 10 ? (line_count_digits + 1) * font().glyph_width('x') + 4 : line_count_digits * font().glyph_width('x') + 4;
constexpr size_t padding = 20;
return line_count() < 10 ? (line_count_digits + 1) * font().glyph_width('x') + padding : line_count_digits * font().glyph_width('x') + padding;
}
Gfx::IntRect TextEditor::ruler_content_rect(size_t line_index) const