Remove Layer trait and simplify Canvas
This commit is contained in:
parent
bb424e54c5
commit
592cc68506
9 changed files with 181 additions and 174 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue