mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibGUI: Clip to paint event rect in most widgets.
This commit is contained in:
@@ -22,9 +22,10 @@ void GTextBox::set_text(String&& text)
|
||||
update();
|
||||
}
|
||||
|
||||
void GTextBox::paint_event(GPaintEvent&)
|
||||
void GTextBox::paint_event(GPaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.set_clip_rect(event.rect());
|
||||
|
||||
painter.fill_rect({ rect().x() + 1, rect().y() + 1, rect().width() - 2, rect().height() - 2 }, background_color());
|
||||
painter.draw_rect(rect(), foreground_color());
|
||||
|
||||
Reference in New Issue
Block a user