make Meshes cheaply cloneable by using Arc<[T]> in iced_graphics::mesh::Indexed

This commit is contained in:
edwloef 2025-10-04 23:47:55 +02:00 committed by Héctor Ramón Jiménez
parent 39ca9e0233
commit 42bc4af972
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 14 additions and 10 deletions

View file

@ -547,8 +547,8 @@ impl BufferStack {
Buffer::Solid(buffer) if !buffer.indices.is_empty() => {
Some(Mesh::Solid {
buffers: mesh::Indexed {
vertices: buffer.vertices,
indices: buffer.indices,
vertices: buffer.vertices.into(),
indices: buffer.indices.into(),
},
clip_bounds,
transformation: Transformation::IDENTITY,
@ -557,8 +557,8 @@ impl BufferStack {
Buffer::Gradient(buffer) if !buffer.indices.is_empty() => {
Some(Mesh::Gradient {
buffers: mesh::Indexed {
vertices: buffer.vertices,
indices: buffer.indices,
vertices: buffer.vertices.into(),
indices: buffer.indices.into(),
},
clip_bounds,
transformation: Transformation::IDENTITY,