mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 01:15:07 +00:00
LibGUI: Clip to paint event rect in most widgets.
This commit is contained in:
parent
737a4d2377
commit
3fe7ddadaf
5 changed files with 10 additions and 5 deletions
|
@ -24,9 +24,10 @@ void GLabel::set_text(String&& text)
|
|||
update();
|
||||
}
|
||||
|
||||
void GLabel::paint_event(GPaintEvent&)
|
||||
void GLabel::paint_event(GPaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.set_clip_rect(event.rect());
|
||||
if (fill_with_background_color())
|
||||
painter.fill_rect({ 0, 0, width(), height() }, background_color());
|
||||
if (m_icon) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue