1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-26 01:55:08 +00:00

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.
This commit is contained in:
Andreas Kling 2021-01-02 00:33:14 +01:00
parent 7e6c27a688
commit c1339baba8

View file

@ -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;
}