diff options
author | 2020-04-29 04:25:49 +0200 | |
---|---|---|
committer | 2020-04-29 04:25:49 +0200 | |
commit | dc51080328caa12d2b1fc02febc72cab70bb9f50 (patch) | |
tree | 0a9781223d1b78a8c404d57b17c61fb0136b196e /examples/clock | |
parent | 5586034d6626e013cdd718aca1c4f19f6a060ff3 (diff) | |
download | iced-dc51080328caa12d2b1fc02febc72cab70bb9f50.tar.gz iced-dc51080328caa12d2b1fc02febc72cab70bb9f50.tar.bz2 iced-dc51080328caa12d2b1fc02febc72cab70bb9f50.zip |
Introduce `Cursor` type in `canvas`
Diffstat (limited to 'examples/clock')
-rw-r--r-- | examples/clock/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index c2beddef..e6b17d8a 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -1,7 +1,7 @@ use iced::{ - canvas::{self, Cache, Canvas, Geometry, LineCap, Path, Stroke}, + canvas::{self, Cache, Canvas, Cursor, Geometry, LineCap, Path, Stroke}, executor, Application, Color, Command, Container, Element, Length, Point, - Settings, Size, Subscription, Vector, + Rectangle, Settings, Subscription, Vector, }; pub fn main() { @@ -75,10 +75,10 @@ impl Application for Clock { } impl canvas::Program<Message> for Clock { - fn draw(&self, bounds: Size) -> Vec<Geometry> { + fn draw(&self, bounds: Rectangle, _cursor: Cursor) -> Vec<Geometry> { use chrono::Timelike; - let clock = self.clock.draw(bounds, |frame| { + let clock = self.clock.draw(bounds.size(), |frame| { let center = frame.center(); let radius = frame.width().min(frame.height()) / 2.0; |