Skip to content

Commit

Permalink
Update layers.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Jun 29, 2024
1 parent b04e364 commit 11904eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/egui/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ impl PaintList {
/// and then later setting it using `paint_list.set(idx, cr, frame);`.
#[inline(always)]
pub fn set(&mut self, idx: ShapeIdx, clip_rect: Rect, shape: Shape) {
if self.0.len() <= idx.0 {
self.add(clip_rect, Shape::Noop);
}

self.0[idx.0] = ClippedShape { clip_rect, shape };
}

Expand Down

0 comments on commit 11904eb

Please sign in to comment.