Skip to content

Commit

Permalink
Merge pull request #760 from TriedAngle/master
Browse files Browse the repository at this point in the history
Update: rand in solar_system example
  • Loading branch information
hecrj authored Mar 5, 2021
2 parents a5fddf9 + 5f27ed4 commit a74974a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/solar_system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ publish = false

[dependencies]
iced = { path = "../..", features = ["canvas", "tokio", "debug"] }
rand = "0.7"
rand = "0.8.3"
8 changes: 3 additions & 5 deletions examples/solar_system/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,13 @@ impl State {
(
Point::new(
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(
-(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()
Expand Down

0 comments on commit a74974a

Please sign in to comment.