More import adjusting.

This commit is contained in:
shan 2022-10-07 13:21:32 -07:00
parent 3e600fe775
commit 215e6c95be
4 changed files with 20 additions and 21 deletions

View file

@ -244,16 +244,4 @@ impl<'a> Layer<'a> {
}
}
}
}
/// Returns the number of total vertices & total indices of all [`Mesh`]es.
pub fn attribute_count_of<'a>(meshes: &'a [Mesh<'a>]) -> (usize, usize) {
meshes
.iter()
.map(|Mesh { buffers, .. }| {
(buffers.vertices.len(), buffers.indices.len())
})
.fold((0, 0), |(total_v, total_i), (v, i)| {
(total_v + v, total_i + i)
})
}
}

View file

@ -37,3 +37,15 @@ impl <'a> Into<Style> for Gradient {
}
}
}
/// Returns the number of total vertices & total indices of all [`Mesh`]es.
pub fn attribute_count_of<'a>(meshes: &'a [Mesh<'a>]) -> (usize, usize) {
meshes
.iter()
.map(|Mesh { buffers, .. }| {
(buffers.vertices.len(), buffers.indices.len())
})
.fold((0, 0), |(total_v, total_i), (v, i)| {
(total_v + v, total_i + i)
})
}