mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-27 15:03:20 +03:00
Fix critical scary Polygon bug that was swapping exterior/interior
This commit is contained in:
parent
4606575c4c
commit
1783ea6b2c
@ -614,7 +614,7 @@ impl From<geo::Polygon<f64>> for Polygon {
|
||||
impl From<Polygon> for geo::Polygon<f64> {
|
||||
fn from(poly: Polygon) -> Self {
|
||||
if let Some(mut rings) = poly.rings {
|
||||
let exterior = rings.pop().expect("expected poly.rings[0] to be exterior");
|
||||
let exterior = rings.remove(0);
|
||||
let interiors: Vec<geo::LineString<f64>> =
|
||||
rings.into_iter().map(geo::LineString::from).collect();
|
||||
Self::new(exterior.into(), interiors)
|
||||
|
Loading…
Reference in New Issue
Block a user