Implement Widget::draw for Image

This commit is contained in:
Héctor Ramón Jiménez 2021-10-25 15:03:57 +07:00
parent e7ae442231
commit 1afbc98544
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 17 additions and 2 deletions

View file

@ -26,6 +26,10 @@ impl<B: Backend> Renderer<B> {
&self.backend
}
pub fn draw_primitive(&mut self, primitive: Primitive) {
self.primitives.push(primitive);
}
pub fn present(&mut self, f: impl FnOnce(&mut B, &[Primitive])) {
f(&mut self.backend, &self.primitives);
}