Split CanvasRasterizer image into many small tiles

This commit is contained in:
2025-06-23 21:35:01 +02:00
parent f2556f7125
commit 61669e15bd
3 changed files with 169 additions and 44 deletions

View File

@ -721,8 +721,10 @@ impl HandwritingStyle {
}
}
fn mesh_triangles(mesh: &Mesh) -> impl Iterator<Item = [&Vertex; 3]> {
mesh.triangles()
fn mesh_triangles(mesh: &Mesh) -> impl Iterator<Item = [&Vertex; 3]> + Clone {
mesh.indices
.chunks_exact(3)
.map(|chunk| [chunk[0], chunk[1], chunk[2]])
.map(|indices| indices.map(|i| &mesh.vertices[i as usize]))
}