mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:25:06 +00:00
LibGUI: Grow the "line content rect" slightly in single line text boxes
Previously we would sometimes leave some pixels from an old selection rect on screen after clearing the selection. It was because the line content rect was smaller than the visual selection rect, and we were using the line content rect for invalidations.
This commit is contained in:
parent
22cd861c7e
commit
558ca65ca5
1 changed files with 1 additions and 1 deletions
|
@ -1031,7 +1031,7 @@ Gfx::Rect TextEditor::line_content_rect(size_t line_index) const
|
|||
{
|
||||
auto& line = this->line(line_index);
|
||||
if (is_single_line()) {
|
||||
Gfx::Rect line_rect = { content_x_for_position({ line_index, 0 }), 0, font().width(line.view()), font().glyph_height() + 2 };
|
||||
Gfx::Rect line_rect = { content_x_for_position({ line_index, 0 }), 0, font().width(line.view()), font().glyph_height() + 4 };
|
||||
line_rect.center_vertically_within({ {}, frame_inner_rect().size() });
|
||||
return line_rect;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue