Skip to content

Commit

Permalink
When you change a lane type, also adjust to the default width for the…
Browse files Browse the repository at this point in the history
… new type. #597
  • Loading branch information
dabreegster committed Jul 23, 2021
1 parent b45f9e0 commit 753a79a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions game/src/edit/roads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,13 @@ impl State<App> for RoadEditor {
});
} else if let Some(lt) = x.strip_prefix("change to ") {
let lt = LaneType::from_short_name(lt).unwrap();
let width =
LaneSpec::typical_lane_widths(lt, &app.primary.map.get_r(self.r).osm_tags)
[0]
.0;
return self.modify_current_lane(ctx, app, Some(0), |new, idx| {
new.lanes_ltr[idx].lt = lt;
new.lanes_ltr[idx].width = width;
});
} else if let Some(lt) = x.strip_prefix("add ") {
let lt = LaneType::from_short_name(lt).unwrap();
Expand Down

0 comments on commit 753a79a

Please sign in to comment.