Remove Layer trait and simplify Canvas

This commit is contained in:
Héctor Ramón Jiménez 2020-04-19 21:55:23 +02:00
parent bb424e54c5
commit 592cc68506
9 changed files with 181 additions and 174 deletions

View file

@ -12,7 +12,7 @@ pub fn main() {
struct Clock {
now: LocalTime,
clock: canvas::layer::Cache<LocalTime>,
clock: canvas::Cache,
}
#[derive(Debug, Clone, Copy)]
@ -59,7 +59,7 @@ impl Application for Clock {
}
fn view(&mut self) -> Element<Message> {
let canvas = Canvas::new(&mut self.clock, &self.now)
let canvas = Canvas::new(self.clock.with(&self.now))
.width(Length::Units(400))
.height(Length::Units(400));