diff options
Diffstat (limited to '')
-rw-r--r-- | examples/arc/src/main.rs | 4 | ||||
-rw-r--r-- | examples/clock/src/main.rs | 6 | ||||
-rw-r--r-- | examples/modern_art/src/main.rs | 7 | ||||
-rw-r--r-- | examples/solar_system/src/main.rs | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/examples/arc/src/main.rs b/examples/arc/src/main.rs index 6029a69c..bc7e49c6 100644 --- a/examples/arc/src/main.rs +++ b/examples/arc/src/main.rs @@ -2,7 +2,7 @@ use std::{f32::consts::PI, time::Instant}; use iced::executor; use iced::widget::canvas::{ - self, Cache, Canvas, Cursor, Geometry, Path, Stroke, StrokeStyle, + self, Cache, Canvas, Cursor, Geometry, Path, Stroke, Style, }; use iced::{ Application, Command, Element, Length, Point, Rectangle, Settings, @@ -114,7 +114,7 @@ impl<Message> canvas::Program<Message> for Arc { frame.stroke( &path, Stroke { - style: StrokeStyle::Solid(palette.text), + style: Style::Solid(palette.text), width: 10.0, ..Stroke::default() }, diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index 51f25a3f..06ed44f0 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -1,6 +1,6 @@ use iced::executor; use iced::widget::canvas::{ - Cache, Cursor, Geometry, LineCap, Path, Stroke, StrokeStyle, + Cache, Cursor, Geometry, LineCap, Path, Stroke, Style, }; use iced::widget::{canvas, container}; use iced::{ @@ -111,7 +111,7 @@ impl<Message> canvas::Program<Message> for Clock { let thin_stroke = || -> Stroke { Stroke { width, - style: StrokeStyle::Solid(Color::WHITE), + style: Style::Solid(Color::WHITE), line_cap: LineCap::Round, ..Stroke::default() } @@ -120,7 +120,7 @@ impl<Message> canvas::Program<Message> for Clock { let wide_stroke = || -> Stroke { Stroke { width: width * 3.0, - style: StrokeStyle::Solid(Color::WHITE), + style: Style::Solid(Color::WHITE), line_cap: LineCap::Round, ..Stroke::default() } diff --git a/examples/modern_art/src/main.rs b/examples/modern_art/src/main.rs index c7945012..238c9a0f 100644 --- a/examples/modern_art/src/main.rs +++ b/examples/modern_art/src/main.rs @@ -1,5 +1,5 @@ use rand::{Rng, thread_rng}; -use crate::canvas::{Cursor, FillStyle, Geometry}; +use crate::canvas::{Cursor, Geometry}; use iced::widget::canvas::{Cache, Fill, Frame}; use iced::widget::{canvas, Canvas}; use iced::Settings; @@ -8,6 +8,7 @@ use iced::{ Renderer, Size, Theme, }; use iced_graphics::gradient::Gradient; +use iced_graphics::widget::canvas::Style; fn main() -> iced::Result { ModernArt::run(Settings { @@ -120,7 +121,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool { top_left, size, Fill { - style: FillStyle::Solid(random_color()), + style: Style::Solid(random_color()), .. Default::default() } ); @@ -129,7 +130,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool { top_left, size, Fill { - style: FillStyle::Gradient(&gradient( + style: Style::Gradient(&gradient( top_left, Point::new(top_left.x + size.width, top_left.y + size.height) )), diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index fcd20561..8d713ce0 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -19,7 +19,7 @@ use iced::{ }; use std::time::Instant; -use crate::canvas::StrokeStyle; +use crate::canvas::Style; pub fn main() -> iced::Result { SolarSystem::run(Settings { @@ -179,7 +179,7 @@ impl<Message> canvas::Program<Message> for State { frame.stroke( &orbit, Stroke { - style: StrokeStyle::Solid(Color::from_rgba8(0, 153, 255, 0.1)), + style: Style::Solid(Color::from_rgba8(0, 153, 255, 0.1)), width: 1.0, line_dash: canvas::LineDash { offset: 0, |