mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 01:13:53 +03:00
adjust roads when moving intersections
This commit is contained in:
parent
e32b540f54
commit
ed29a208e4
@ -210,7 +210,15 @@ impl Model {
|
||||
// Now update all the roads.
|
||||
for r in self.roads_per_intersection.get(id).clone() {
|
||||
self.road_deleted(r);
|
||||
// TODO Do the mutation
|
||||
|
||||
let road = self.map.roads.get_mut(&r).unwrap();
|
||||
if road.i1 == id {
|
||||
road.center_points[0] = point;
|
||||
} else {
|
||||
assert_eq!(road.i2, id);
|
||||
*road.center_points.last_mut().unwrap() = point;
|
||||
}
|
||||
|
||||
self.road_added(r, prerender);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user