summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-06-16 12:26:03 -0700
committerLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-06-16 12:26:03 -0700
commitaae880ca5d50b144abdae482a92cefbffcdf3a40 (patch)
treef4944350c2bb6026fd26c5dad0253038487a294d /examples
parent449bbb112e0c1e07c34cbf88786062c1ff7361c1 (diff)
downloadiced-aae880ca5d50b144abdae482a92cefbffcdf3a40.tar.gz
iced-aae880ca5d50b144abdae482a92cefbffcdf3a40.tar.bz2
iced-aae880ca5d50b144abdae482a92cefbffcdf3a40.zip
Fix alpha blending for wgpu msaa
Diffstat (limited to 'examples')
-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 12184dd1..e96b53ff 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -48,6 +48,10 @@ impl Application for SolarSystem {
String::from("Solar system - Iced")
}
+ fn background_color(&self) -> Color {
+ Color::BLACK
+ }
+
fn update(&mut self, message: Message) -> Command<Message> {
match message {
Message::Tick(instant) => {
@@ -137,16 +141,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);
});