mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-15 19:21:38 +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
Notes:
sideshowbarker
2024-07-19 06:29:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/558ca65ca55
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…
Reference in a new issue