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:
parent
31d659d9a0
commit
a08dd5b99c
1 changed files with 4 additions and 1 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue