Update image updates in all threads at the same time

This commit is contained in:
Tim Visée
2018-02-12 15:40:58 +01:00
parent 68b56ccf92
commit e74b6f7108
2 changed files with 18 additions and 15 deletions

View File

@@ -95,14 +95,8 @@ impl Canvas {
// Do some work
loop {
// Work
painter.work()
painter.work(&rx)
.expect("Painter failed to perform work");
// Update the image to paint
if let Ok(image) = rx.try_recv() {
painter.set_image(image);
}
}
});