Merge pull request #278 from hecrj/fix/canvas-empty-mesh
Stop generating empty `Mesh2D` in `canvas::Frame`
This commit is contained in:
commit
867dad62fa
@ -262,6 +262,7 @@ impl Frame {
|
|||||||
///
|
///
|
||||||
/// [`Frame`]: struct.Frame.html
|
/// [`Frame`]: struct.Frame.html
|
||||||
pub fn into_primitive(mut self) -> Primitive {
|
pub fn into_primitive(mut self) -> Primitive {
|
||||||
|
if !self.buffers.indices.is_empty() {
|
||||||
self.primitives.push(Primitive::Mesh2D {
|
self.primitives.push(Primitive::Mesh2D {
|
||||||
origin: Point::ORIGIN,
|
origin: Point::ORIGIN,
|
||||||
buffers: triangle::Mesh2D {
|
buffers: triangle::Mesh2D {
|
||||||
@ -269,6 +270,7 @@ impl Frame {
|
|||||||
indices: self.buffers.indices,
|
indices: self.buffers.indices,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Primitive::Group {
|
Primitive::Group {
|
||||||
primitives: self.primitives,
|
primitives: self.primitives,
|
||||||
|
Loading…
Reference in New Issue
Block a user