hopefully improve behavior when widgets overlap
This commit is contained in:
parent
854e7d1d74
commit
035522591f
1 changed files with 5 additions and 0 deletions
|
@ -149,6 +149,11 @@ void Widget::handle_repaint_rect(RepaintRectEvent &event) {
|
|||
|
||||
cr->save();
|
||||
|
||||
// clip to the event's invalidation rectangle. this is because widgets tend to also draw things like text,
|
||||
// which sometimes goes outside the invalidation rectangle
|
||||
painter.rounded_rectangle(event.box(), 0);
|
||||
cr->clip();
|
||||
|
||||
// clip this widget. this ensures that the background fill or children won't overflow the bounds of it
|
||||
painter.rounded_rectangle(m_rect, m_style->border_radius());
|
||||
cr->clip();
|
||||
|
|
Loading…
Reference in a new issue