summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:30:12 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:30:12 +0200
commit92bd3ecd6b4a6618f0fc725dea3694c3b40e5314 (patch)
tree8040fe0f758eb41cbf587119c5d972f5ebaa8567 /examples
parent974ae6d1e7cd9df6967762a6d308106f4fe03edc (diff)
downloadiced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.tar.gz
iced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.tar.bz2
iced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.zip
Introduce `Image` struct in `core::image`
Diffstat (limited to 'examples')
-rw-r--r--examples/solar_system/src/main.rs15
1 files changed, 3 insertions, 12 deletions
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index a4931465..9da9fd34 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -160,11 +160,8 @@ impl<Message> canvas::Program<Message> for State {
frame.translate(Vector::new(center.x, center.y));
frame.draw_image(
- &self.sun,
Rectangle::with_radius(Self::SUN_RADIUS),
- image::FilterMethod::Linear,
- 0,
- 1.0,
+ &self.sun,
);
let orbit = Path::circle(Point::ORIGIN, Self::ORBIT_RADIUS);
@@ -189,22 +186,16 @@ impl<Message> canvas::Program<Message> for State {
frame.translate(Vector::new(Self::ORBIT_RADIUS, 0.0));
frame.draw_image(
- &self.earth,
Rectangle::with_radius(Self::EARTH_RADIUS),
- image::FilterMethod::Linear,
- rotation * 20.0,
- 1.0,
+ canvas::Image::new(&self.earth).rotation(rotation * 20.0),
);
frame.rotate(rotation * 10.0);
frame.translate(Vector::new(0.0, Self::MOON_DISTANCE));
frame.draw_image(
- &self.moon,
Rectangle::with_radius(Self::MOON_RADIUS),
- image::FilterMethod::Linear,
- 0,
- 1.0,
+ &self.moon,
);
});