I somehow managed to break pedestrian rendering in 004ca95842

This commit is contained in:
Dustin Carlino 2020-10-27 15:41:33 -07:00
parent 3b26d25fe4
commit 41712b5beb

View File

@ -67,16 +67,17 @@ impl Circle {
/// Returns the ring around the circle.
fn to_ring(&self) -> Ring {
Ring::must_new(
(0..=TRIANGLES_PER_CIRCLE)
let mut pts: Vec<Pt2D> = (0..=TRIANGLES_PER_CIRCLE)
.map(|i| {
self.center.project_away(
self.radius,
Angle::degrees((i as f64) / (TRIANGLES_PER_CIRCLE as f64) * 360.0),
)
})
.collect(),
)
.collect();
// With some radii, we get duplicate adjacent points
pts.dedup();
Ring::must_new(pts)
}
/// Creates an outline around the circle, strictly contained with the circle's original radius.