MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / draw

Method draw

canvas/src/canvas.rs:121–131  ·  view source on GitHub ↗

Provides a way to draw on this canvas via a GC

(&self, action: FnAction)

Source from the content-addressed store, hash-verified

119 /// Provides a way to draw on this canvas via a GC
120 ///
121 pub fn draw<FnAction>(&self, action: FnAction)
122 where FnAction: Send+FnOnce(&mut CanvasGraphicsContext) -> () {
123 self.core.sync(move |core| {
124 let mut graphics_context = CanvasGraphicsContext {
125 core: core,
126 pending: vec![]
127 };
128
129 action(&mut graphics_context);
130 })
131 }
132
133 ///
134 /// Creates a stream for reading the instructions from this canvas

Calls

no outgoing calls