Fixed import issue with canvas in the gradient mod for situations where canvas feature is not enabled.

This commit is contained in:
shan 2022-10-07 16:28:13 -07:00
parent 215e6c95be
commit a4a1262fa2
5 changed files with 27 additions and 33 deletions

View file

@ -11,7 +11,7 @@ use iced::executor;
use iced::theme::{self, Theme};
use iced::time;
use iced::widget::canvas;
use iced::widget::canvas::{Cursor, Path, Stroke, Fill, fill, Gradient, stroke, gradient::Position};
use iced::widget::canvas::{Cursor, Path, Stroke, Gradient, stroke, gradient::Position};
use iced::window;
use iced::{
Application, Color, Command, Element, Length, Point, Rectangle, Settings,
@ -212,13 +212,7 @@ impl<Message> canvas::Program<Message> for State {
.build()
.unwrap();
frame.fill(
&earth,
Fill {
style: fill::Style::Gradient(&earth_fill),
..Default::default()
},
);
frame.fill(&earth, &earth_fill);
frame.with_save(|frame| {
frame.rotate(rotation * 10.0);