epaint tessellator: don't emit empty meshes
Closes https://github.com/emilk/egui/issues/1772
This commit is contained in:
parent
77b4bacdf4
commit
fdc2d1cd6d
1 changed files with 8 additions and 0 deletions
|
@ -1544,6 +1544,14 @@ pub fn tessellate_shapes(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clipped_primitives.retain(|p| {
|
||||||
|
p.clip_rect.is_positive()
|
||||||
|
&& match &p.primitive {
|
||||||
|
Primitive::Mesh(mesh) => !mesh.is_empty(),
|
||||||
|
Primitive::Callback(_) => true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
for clipped_primitive in &clipped_primitives {
|
for clipped_primitive in &clipped_primitives {
|
||||||
if let Primitive::Mesh(mesh) = &clipped_primitive.primitive {
|
if let Primitive::Mesh(mesh) = &clipped_primitive.primitive {
|
||||||
crate::epaint_assert!(mesh.is_valid(), "Tessellator generated invalid Mesh");
|
crate::epaint_assert!(mesh.is_valid(), "Tessellator generated invalid Mesh");
|
||||||
|
|
Loading…
Reference in a new issue