Skip to content

Commit

Permalink
Fix bug when debug-painting clip rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Feb 19, 2022
1 parent aa53522 commit 3a5ec47
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions epaint/src/tessellator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,16 +1026,20 @@ pub fn tessellate_shapes(

if options.debug_paint_clip_rects {
for ClippedMesh(clip_rect, mesh) in &mut clipped_meshes {
tessellator.clip_rect = Rect::EVERYTHING;
tessellator.tessellate_shape(
tex_size,
Shape::rect_stroke(
*clip_rect,
0.0,
Stroke::new(2.0, Color32::from_rgb(150, 255, 150)),
),
mesh,
);
if mesh.texture_id == TextureId::default() {
tessellator.clip_rect = Rect::EVERYTHING;
tessellator.tessellate_shape(
tex_size,
Shape::rect_stroke(
*clip_rect,
0.0,
Stroke::new(2.0, Color32::from_rgb(150, 255, 150)),
),
mesh,
);
} else {
// TODO: create a new `ClippedMesh` just for the painted clip rectangle
}
}
}

Expand Down

0 comments on commit 3a5ec47

Please sign in to comment.