summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 05:19:58 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 05:19:58 +0100
commite07344428de93055ac4b4f7e02505bbcbc43ab98 (patch)
tree7d9991b875e0f35e07b5da1b4132f95534391268 /examples
parentd8045e2dc30633553e087ad6f7748235223017d7 (diff)
downloadiced-e07344428de93055ac4b4f7e02505bbcbc43ab98.tar.gz
iced-e07344428de93055ac4b4f7e02505bbcbc43ab98.tar.bz2
iced-e07344428de93055ac4b4f7e02505bbcbc43ab98.zip
Refactor imports in `solar_system` example
Diffstat (limited to 'examples')
-rw-r--r--examples/solar_system/src/main.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 09ac508d..8d27d154 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -11,9 +11,9 @@ use iced::executor;
use iced::theme::{self, Theme};
use iced::time;
use iced::widget::canvas;
-use iced::widget::canvas::{
- gradient::Position, stroke, Cursor, Gradient, Path, Stroke,
-};
+use iced::widget::canvas::gradient::{self, Gradient};
+use iced::widget::canvas::stroke::{self, Stroke};
+use iced::widget::canvas::{Cursor, Path};
use iced::window;
use iced::{
Application, Color, Command, Element, Length, Point, Rectangle, Settings,
@@ -203,14 +203,15 @@ impl<Message> canvas::Program<Message> for State {
let earth = Path::circle(Point::ORIGIN, Self::EARTH_RADIUS);
- let earth_fill = Gradient::linear(Position::Absolute {
- start: Point::new(-Self::EARTH_RADIUS, 0.0),
- end: Point::new(Self::EARTH_RADIUS, 0.0),
- })
- .add_stop(0.2, Color::from_rgb(0.15, 0.50, 1.0))
- .add_stop(0.8, Color::from_rgb(0.0, 0.20, 0.47))
- .build()
- .unwrap();
+ let earth_fill =
+ Gradient::linear(gradient::Position::Absolute {
+ start: Point::new(-Self::EARTH_RADIUS, 0.0),
+ end: Point::new(Self::EARTH_RADIUS, 0.0),
+ })
+ .add_stop(0.2, Color::from_rgb(0.15, 0.50, 1.0))
+ .add_stop(0.8, Color::from_rgb(0.0, 0.20, 0.47))
+ .build()
+ .expect("Build Earth fill gradient");
frame.fill(&earth, &earth_fill);