Skip to content

Commit da95f3d

Browse files
committed
clip widgets whose layout rect doesn't intersect with the current clip rect
1 parent ea817f3 commit da95f3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/yakui-core/src/paint/paint_dom.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ impl PaintDom {
9696
profiling::scope!("PaintDom::paint");
9797

9898
let layout_node = layout.get(id).unwrap();
99+
if !(layout_node.rect.size() == Vec2::ZERO // always paint if layout rect is zero-sized
100+
|| layout_node.clip.intersects(&layout_node.rect))
101+
{
102+
return;
103+
}
104+
99105
self.current_clip = Rect::from_pos_size(
100106
(layout_node.clip.pos() * self.scale_factor).round(),
101107
(layout_node.clip.size() * self.scale_factor).round(),

0 commit comments

Comments
 (0)