summaryrefslogtreecommitdiffstats
path: root/examples/solar_system/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-19 03:32:21 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-19 03:32:21 +0200
commit4c1a082f0468a59099bbf8aa8991420a41234948 (patch)
tree42308071bc180f364c71cdc0bb0011235c01fe14 /examples/solar_system/src
parent6551a0b2ab6c831dd1d3646ecf55180339275e22 (diff)
downloadiced-4c1a082f0468a59099bbf8aa8991420a41234948.tar.gz
iced-4c1a082f0468a59099bbf8aa8991420a41234948.tar.bz2
iced-4c1a082f0468a59099bbf8aa8991420a41234948.zip
Remove `Builder` abstractions for gradients
Diffstat (limited to 'examples/solar_system/src')
-rw-r--r--examples/solar_system/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 42606e3f..d9e660d7 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -10,8 +10,9 @@ use iced::application;
use iced::executor;
use iced::theme::{self, Theme};
use iced::widget::canvas;
+use iced::widget::canvas::gradient;
use iced::widget::canvas::stroke::{self, Stroke};
-use iced::widget::canvas::{Cursor, Gradient, Path};
+use iced::widget::canvas::{Cursor, Path};
use iced::window;
use iced::{
Application, Color, Command, Element, Length, Point, Rectangle, Renderer,
@@ -209,13 +210,12 @@ impl<Message> canvas::Program<Message> for State {
let earth = Path::circle(Point::ORIGIN, Self::EARTH_RADIUS);
- let earth_fill = Gradient::linear(
+ let earth_fill = gradient::Linear::new(
Point::new(-Self::EARTH_RADIUS, 0.0),
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();
+ .add_stop(0.8, Color::from_rgb(0.0, 0.20, 0.47));
frame.fill(&earth, earth_fill);