mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
GTextEditor: Paint line numbers with TopRight text alignment
This makes sure they line up with the first visual line for wrapped lines that span multiple visual lines.
This commit is contained in:
parent
a791b86afa
commit
6ab498edf7
Notes:
sideshowbarker
2024-07-19 12:15:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6ab498edf79
1 changed files with 2 additions and 2 deletions
|
@ -340,10 +340,10 @@ void GTextEditor::paint_event(GPaintEvent& event)
|
|||
bool is_current_line = i == m_cursor.line();
|
||||
auto ruler_line_rect = ruler_content_rect(i);
|
||||
painter.draw_text(
|
||||
ruler_line_rect.shrunken(2, 0),
|
||||
ruler_line_rect.shrunken(2, 0).translated(0, m_line_spacing / 2),
|
||||
String::number(i + 1),
|
||||
is_current_line ? Font::default_bold_font() : font(),
|
||||
TextAlignment::CenterRight,
|
||||
TextAlignment::TopRight,
|
||||
is_current_line ? Color::DarkGray : Color::MidGray);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue