1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

LibGUI: Turn a heap-allocated event into a stack-allocated one

This commit is contained in:
Andreas Kling 2020-07-16 20:44:49 +02:00
parent 6d27915f4b
commit 5f0d24cab2

View file

@ -303,8 +303,10 @@ void Window::event(Core::Event& event)
rects.append({ {}, paint_event.window_size() });
}
for (auto& rect : rects)
m_main_widget->dispatch_event(*make<PaintEvent>(rect), this);
for (auto& rect : rects) {
PaintEvent paint_event(rect);
m_main_widget->dispatch_event(paint_event, this);
}
if (m_double_buffering_enabled)
flip(rects);