Merge pull request #760 from TriedAngle/master

Update: rand in solar_system example
This commit is contained in:
Héctor Ramón 2021-03-05 03:10:55 +01:00 committed by GitHub
commit a74974a8e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -7,4 +7,4 @@ publish = false
[dependencies] [dependencies]
iced = { path = "../..", features = ["canvas", "tokio", "debug"] } iced = { path = "../..", features = ["canvas", "tokio", "debug"] }
rand = "0.7" rand = "0.8.3"

View file

@ -117,15 +117,13 @@ impl State {
( (
Point::new( Point::new(
rng.gen_range( rng.gen_range(
-(width as f32) / 2.0, (-(width as f32) / 2.0)..(width as f32 / 2.0),
width as f32 / 2.0,
), ),
rng.gen_range( rng.gen_range(
-(height as f32) / 2.0, (-(height as f32) / 2.0)..(height as f32 / 2.0),
height as f32 / 2.0,
), ),
), ),
rng.gen_range(0.5, 1.0), rng.gen_range(0.5..1.0),
) )
}) })
.collect() .collect()