summaryrefslogtreecommitdiffstats
path: root/examples/clock
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:54:12 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:54:12 +0200
commit46cd0891d25c2dd48e182747d8c1f9579b066490 (patch)
tree0ab07cb96727530b4ea5298d5a22a6a883c25568 /examples/clock
parentc545af35773307d16eca7ec03ed4794f26491da2 (diff)
downloadiced-46cd0891d25c2dd48e182747d8c1f9579b066490.tar.gz
iced-46cd0891d25c2dd48e182747d8c1f9579b066490.tar.bz2
iced-46cd0891d25c2dd48e182747d8c1f9579b066490.zip
Implement `canvas::Path::circle` helper method
Diffstat (limited to 'examples/clock')
-rw-r--r--examples/clock/src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs
index 1379d3a6..dab91eab 100644
--- a/examples/clock/src/main.rs
+++ b/examples/clock/src/main.rs
@@ -95,11 +95,13 @@ impl From<chrono::DateTime<chrono::Local>> for LocalTime {
impl canvas::Drawable for LocalTime {
fn draw(&self, frame: &mut canvas::Frame) {
+ use canvas::Path;
+
let center = frame.center();
let radius = frame.width().min(frame.height()) / 2.0;
let offset = Vector::new(center.x, center.y);
- let clock = canvas::Path::new(|path| path.circle(center, radius));
+ let clock = Path::circle(center, radius);
frame.fill(&clock, Color::from_rgb8(0x12, 0x93, 0xD8));