summaryrefslogtreecommitdiff
path: root/Userland/Demos/LibGfxDemo/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-09 10:11:30 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-09 10:11:30 +0200
commit41dc73adc46e040f6de5353fa9ace22da7199766 (patch)
treef7e63c44ec8b7ee6884c0dec6d6da32e6f94c9b7 /Userland/Demos/LibGfxDemo/main.cpp
parent6998fa5c54aa91520cfe279b6c480eb87c0831fc (diff)
downloadserenity-41dc73adc46e040f6de5353fa9ace22da7199766.zip
Demos: Fix a bunch of incorrect use of GUI::PaintEvent::rect()
A bunch of programs were using the paint event rect as the rect to draw into. Since the event rect could be any invalidated part of the widget, we need to be passing the full Widget::rect().
Diffstat (limited to 'Userland/Demos/LibGfxDemo/main.cpp')
-rw-r--r--Userland/Demos/LibGfxDemo/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp
index 0077855bea..34acadd7f4 100644
--- a/Userland/Demos/LibGfxDemo/main.cpp
+++ b/Userland/Demos/LibGfxDemo/main.cpp
@@ -47,7 +47,8 @@ Canvas::~Canvas()
void Canvas::paint_event(GUI::PaintEvent& event)
{
GUI::Painter painter(*this);
- painter.draw_scaled_bitmap(event.rect(), *m_bitmap, m_bitmap->rect());
+ painter.add_clip_rect(event.rect());
+ painter.draw_scaled_bitmap(rect(), *m_bitmap, m_bitmap->rect());
}
void Canvas::draw()