summaryrefslogtreecommitdiffstats
path: root/examples/solar_system
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-08 19:31:45 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-08 19:31:45 +0200
commitfa55dff61db47197a961152285c6a6abfab0b217 (patch)
tree44904afb16a0cab9e22fce0d73a5616676cd426b /examples/solar_system
parent1dd1a2f97fc747e15e12b5188dad6c41b0d052ea (diff)
parent66eb6263003c1bbedd1fd14d6b12f172d20a6211 (diff)
downloadiced-fa55dff61db47197a961152285c6a6abfab0b217.tar.gz
iced-fa55dff61db47197a961152285c6a6abfab0b217.tar.bz2
iced-fa55dff61db47197a961152285c6a6abfab0b217.zip
Merge branch 'master' into theming
Diffstat (limited to 'examples/solar_system')
-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 5f6c309d..7e0e06b0 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -73,6 +73,10 @@ impl Application for SolarSystem {
.height(Length::Fill)
.into()
}
+
+ fn theme(&self) -> Theme {
+ Theme::Dark
+ }
}
#[derive(Debug)]
@@ -142,16 +146,12 @@ impl<Message> canvas::Program<Message> for State {
use std::f32::consts::PI;
let background = self.space_cache.draw(bounds.size(), |frame| {
- let space = Path::rectangle(Point::new(0.0, 0.0), frame.size());
-
let stars = Path::new(|path| {
for (p, size) in &self.stars {
path.rectangle(*p, Size::new(*size, *size));
}
});
- frame.fill(&space, Color::BLACK);
-
frame.translate(frame.center() - Point::ORIGIN);
frame.fill(&stars, Color::WHITE);
});