mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
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:
parent
6998fa5c54
commit
41dc73adc4
6 changed files with 8 additions and 14 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue