Implement Primitive::Cached
This commit is contained in:
parent
37f0d97159
commit
b74e7e7353
12 changed files with 151 additions and 105 deletions
|
|
@ -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,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue