diff options
Diffstat (limited to 'examples/pure/arc/src/main.rs')
-rw-r--r-- | examples/pure/arc/src/main.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/pure/arc/src/main.rs b/examples/pure/arc/src/main.rs index 38b3f502..df0e1e8a 100644 --- a/examples/pure/arc/src/main.rs +++ b/examples/pure/arc/src/main.rs @@ -5,9 +5,7 @@ use iced::pure::widget::canvas::{ self, Cache, Canvas, Cursor, Geometry, Path, Stroke, }; use iced::pure::{Application, Element}; -use iced::{ - Color, Command, Length, Point, Rectangle, Settings, Subscription, Theme, -}; +use iced::{Command, Length, Point, Rectangle, Settings, Subscription, Theme}; pub fn main() -> iced::Result { Arc::run(Settings { @@ -80,6 +78,8 @@ impl<Message> canvas::Program<Message> for Arc { _cursor: Cursor, ) -> Vec<Geometry> { let geometry = self.cache.draw(bounds.size(), |frame| { + let palette = theme.palette(); + let center = frame.center(); let radius = frame.width().min(frame.height()) / 5.0; @@ -101,7 +101,7 @@ impl<Message> canvas::Program<Message> for Arc { b.circle(end, 10.0); }); - frame.fill(&circles, Color::WHITE); + frame.fill(&circles, palette.text); let path = Path::new(|b| { b.move_to(start); @@ -109,8 +109,6 @@ impl<Message> canvas::Program<Message> for Arc { b.line_to(end); }); - let palette = theme.palette(); - frame.stroke( &path, Stroke { |