summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-02 00:33:14 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-02 00:35:34 +0100
commitc1339baba8374a9d5b9c6e8190aa76b7c6a7f5fa (patch)
tree9ee653ded7f0c7f6b5c65db33289cf92eb64b3ed /Libraries/LibGUI
parent7e6c27a6884829846391d905380346c3b485db9b (diff)
downloadserenity-c1339baba8374a9d5b9c6e8190aa76b7c6a7f5fa.zip
LibGUI: Fix cursor height in single-line text boxes
We should use the TextEditor::line_height() for the cursor height, same as we do in multi-line mode.
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/TextEditor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp
index cfbc16b833..1993145e48 100644
--- a/Libraries/LibGUI/TextEditor.cpp
+++ b/Libraries/LibGUI/TextEditor.cpp
@@ -1134,7 +1134,7 @@ Gfx::IntRect TextEditor::content_rect_for_position(const TextPosition& position)
int x = content_x_for_position(position);
if (is_single_line()) {
- Gfx::IntRect rect { x, 0, 1, font().glyph_height() + 2 };
+ Gfx::IntRect rect { x, 0, 1, line_height() };
rect.center_vertically_within({ {}, frame_inner_rect().size() });
return rect;
}