From dc51080328caa12d2b1fc02febc72cab70bb9f50 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 29 Apr 2020 04:25:49 +0200 Subject: Introduce `Cursor` type in `canvas` --- examples/clock/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/clock/src/main.rs') 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 for Clock { - fn draw(&self, bounds: Size) -> Vec { + fn draw(&self, bounds: Rectangle, _cursor: Cursor) -> Vec { 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; -- cgit