1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

Mandelbrot: Use a GUI::Frame to paint into

This allows us to have a frame border which looks nicer.
This commit is contained in:
sin-ack 2021-08-08 13:39:50 +00:00 committed by Gunnar Beutner
parent 31d659d9a0
commit a08dd5b99c

View file

@ -137,7 +137,7 @@ private:
}
};
class Mandelbrot : public GUI::Widget {
class Mandelbrot : public GUI::Frame {
C_OBJECT(Mandelbrot)
void export_image(String const& export_path);
@ -158,7 +158,10 @@ private:
void Mandelbrot::paint_event(GUI::PaintEvent& event)
{
Frame::paint_event(event);
GUI::Painter painter(*this);
painter.add_clip_rect(frame_inner_rect());
painter.add_clip_rect(event.rect());
painter.draw_scaled_bitmap(rect(), m_set.bitmap(), m_set.bitmap().rect());