Implement Primitive::Cached

This commit is contained in:
Héctor Ramón Jiménez 2020-03-07 23:45:54 +01:00
parent 37f0d97159
commit b74e7e7353
12 changed files with 151 additions and 105 deletions

View file

@ -23,7 +23,6 @@ mod bezier {
basic_shapes, BuffersBuilder, StrokeAttributes, StrokeOptions,
StrokeTessellator, VertexBuffers,
};
use std::sync::Arc;
pub struct Bezier<'a, Message> {
state: &'a mut State,
@ -175,10 +174,10 @@ mod bezier {
let mesh = Primitive::Mesh2D {
origin: Point::new(bounds.x, bounds.y),
buffers: Arc::new(Mesh2D {
buffers: Mesh2D {
vertices: buffer.vertices,
indices: buffer.indices,
}),
},
};
(

View file

@ -87,7 +87,7 @@ mod rainbow {
(
Primitive::Mesh2D {
origin: Point::new(b.x, b.y),
buffers: std::sync::Arc::new(Mesh2D {
buffers: Mesh2D {
vertices: vec![
Vertex2D {
position: posn_center,
@ -136,7 +136,7 @@ mod rainbow {
0, 7, 8, // BL
0, 8, 1, // L
],
}),
},
},
MouseCursor::OutOfBounds,
)