Stop generating empty Mesh2D in canvas::Frame
This commit is contained in:
parent
d51b501d2f
commit
10f5f95a80
1 changed files with 9 additions and 7 deletions
|
|
@ -262,13 +262,15 @@ impl Frame {
|
|||
///
|
||||
/// [`Frame`]: struct.Frame.html
|
||||
pub fn into_primitive(mut self) -> Primitive {
|
||||
self.primitives.push(Primitive::Mesh2D {
|
||||
origin: Point::ORIGIN,
|
||||
buffers: triangle::Mesh2D {
|
||||
vertices: self.buffers.vertices,
|
||||
indices: self.buffers.indices,
|
||||
},
|
||||
});
|
||||
if !self.buffers.indices.is_empty() {
|
||||
self.primitives.push(Primitive::Mesh2D {
|
||||
origin: Point::ORIGIN,
|
||||
buffers: triangle::Mesh2D {
|
||||
vertices: self.buffers.vertices,
|
||||
indices: self.buffers.indices,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Primitive::Group {
|
||||
primitives: self.primitives,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue