summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-06 19:24:16 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-06 19:24:16 +0200
commit6ab498edf798a2b749f38bfb78e67a55327a4ec1 (patch)
treead7214dd5d250b321d5861beca403b65b2df9779 /Libraries/LibGUI
parenta791b86afa5fef25a049b1b14da77679a9928946 (diff)
downloadserenity-6ab498edf798a2b749f38bfb78e67a55327a4ec1.zip
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.
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/GTextEditor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/GTextEditor.cpp b/Libraries/LibGUI/GTextEditor.cpp
index 80ca207233..6e69f9de0d 100644
--- a/Libraries/LibGUI/GTextEditor.cpp
+++ b/Libraries/LibGUI/GTextEditor.cpp
@@ -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);
}
}