mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibGfx: Intersect the bounding box with the main rect in draw_text
Without this, the bounding rect for the text as generated by TextLayout can go beyond the bounds of the user-supplied drawing rect and cause the text to overlap because of the line_rect.intersect(rect) a few lines below.
This commit is contained in:
parent
ed6c1f53af
commit
1999b66f38
1 changed files with 2 additions and 0 deletions
|
@ -1471,6 +1471,8 @@ void Painter::do_draw_text(IntRect const& rect, Utf8View const& text, Font const
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
bounding_rect.intersect(rect);
|
||||
|
||||
for (size_t i = 0; i < lines.size(); ++i) {
|
||||
auto line = Utf8View { lines[i] };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue