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().
This commit is contained in:
Andreas Kling 2021-05-09 10:11:30 +02:00
commit 41dc73adc4
Notes: sideshowbarker 2024-07-18 18:28:07 +09:00
6 changed files with 8 additions and 14 deletions

View file

@ -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()