Provides a way to draw on this canvas via a GC
(&self, action: FnAction)
| 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 |
no outgoing calls