1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 17:25:07 +00:00

LibGUI: Clip to paint event rect in most widgets.

This commit is contained in:
Andreas Kling 2019-02-28 19:34:55 +01:00
parent 737a4d2377
commit 3fe7ddadaf
5 changed files with 10 additions and 5 deletions

View file

@ -50,9 +50,10 @@ void GCheckBox::set_checked(bool b)
update();
}
void GCheckBox::paint_event(GPaintEvent&)
void GCheckBox::paint_event(GPaintEvent& event)
{
Painter painter(*this);
painter.set_clip_rect(event.rect());
auto text_rect = rect();
text_rect.set_left(s_box_width + 4);