mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:57:35 +00:00
LibGUI: Clip GUI::Frame children to the frame_inner_rect()
This way we don't draw the frame border underneath our children. :^)
This commit is contained in:
parent
a265d40d6e
commit
ac78531756
2 changed files with 8 additions and 0 deletions
|
@ -59,4 +59,10 @@ void Frame::paint_event(PaintEvent& event)
|
||||||
painter.add_clip_rect(event.rect());
|
painter.add_clip_rect(event.rect());
|
||||||
Gfx::StylePainter::paint_frame(painter, rect(), palette(), m_shape, m_shadow, m_thickness, spans_entire_window_horizontally());
|
Gfx::StylePainter::paint_frame(painter, rect(), palette(), m_shape, m_shadow, m_thickness, spans_entire_window_horizontally());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gfx::IntRect Frame::children_clip_rect() const
|
||||||
|
{
|
||||||
|
return frame_inner_rect();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ public:
|
||||||
Gfx::IntRect frame_inner_rect_for_size(const Gfx::IntSize& size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; }
|
Gfx::IntRect frame_inner_rect_for_size(const Gfx::IntSize& size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; }
|
||||||
Gfx::IntRect frame_inner_rect() const { return frame_inner_rect_for_size(size()); }
|
Gfx::IntRect frame_inner_rect() const { return frame_inner_rect_for_size(size()); }
|
||||||
|
|
||||||
|
virtual Gfx::IntRect children_clip_rect() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Frame();
|
Frame();
|
||||||
void paint_event(PaintEvent&) override;
|
void paint_event(PaintEvent&) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue