mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
Cleanup formatting after #371
This commit is contained in:
parent
c74dcf025f
commit
536971b641
@ -4,7 +4,6 @@ use std::fmt;
|
||||
use geo::algorithm::area::Area;
|
||||
use geo::algorithm::convex_hull::ConvexHull;
|
||||
use geo_booleanop::boolean::BooleanOp;
|
||||
use geo::algorithm::intersects::Intersects;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{Angle, Bounds, Distance, HashablePt2D, PolyLine, Pt2D, Ring};
|
||||
@ -302,8 +301,7 @@ impl Polygon {
|
||||
}
|
||||
|
||||
pub fn polylabel(&self) -> Pt2D {
|
||||
let polygon: geo::Polygon<_> = to_geo(&self.points());
|
||||
let pt = polylabel::polylabel(&polygon, &1.0).unwrap();
|
||||
let pt = polylabel::polylabel(&to_geo(&self.points()), &1.0).unwrap();
|
||||
Pt2D::new(pt.x(), pt.y())
|
||||
}
|
||||
|
||||
@ -315,7 +313,9 @@ impl Polygon {
|
||||
Ok(Polygon::union_all(
|
||||
rings.iter().map(|r| r.to_outline(thickness)).collect(),
|
||||
))
|
||||
} else { Ring::new(self.points.clone()).map(|r| r.to_outline(thickness)) }
|
||||
} else {
|
||||
Ring::new(self.points.clone()).map(|r| r.to_outline(thickness))
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove the internal rings used for to_outline. This is fine to do if the polygon is being
|
||||
|
Loading…
Reference in New Issue
Block a user