diff --git a/docs/lanes.md b/docs/lanes.md index 5afc1277a7..e9658fb45c 100644 --- a/docs/lanes.md +++ b/docs/lanes.md @@ -95,11 +95,10 @@ wait slow down even more -- before any of this change, lanes on adjacent roads s ---> option 1: module per object type, geometry and graph squished together - option 2: try to separate the graph/geom stuff within map model. - CLEANUP: no more 'extern crate' in non lib - - - CLEANUP: gps to screen in map upfront, dont plumb along gps pts for bldg/parcel/etc, so bounds should become private. - pt2d should no longer represent gps + - CLEANUP: bldg front path should happen upfront, not in render - THEN: express the proto -> runtime map loading as a sequence of phases - keep doing the current road trimming for the moment diff --git a/editor/src/render/map.rs b/editor/src/render/map.rs index d9826916b1..4aada06907 100644 --- a/editor/src/render/map.rs +++ b/editor/src/render/map.rs @@ -27,9 +27,7 @@ pub struct DrawMap { impl DrawMap { // Also returns the center of the map in map-space - pub fn new(map: &Map) -> (DrawMap, Bounds, Pt2D) { - let bounds = map.get_gps_bounds(); - + pub fn new(map: &Map) -> (DrawMap, Pt2D) { let mut roads: Vec = Vec::new(); for r in map.all_roads() { roads.push(DrawRoad::new(r)); @@ -74,6 +72,7 @@ impl DrawMap { .collect(); // min_y here due to the wacky y inversion + let bounds = map.get_gps_bounds(); let max_screen_pt = geometry::gps_to_screen_space(&Pt2D::new(bounds.max_x, bounds.min_y), &bounds); let map_bbox = Rect { @@ -119,7 +118,6 @@ impl DrawMap { buildings_quadtree, parcels_quadtree, }, - bounds, Pt2D::new(max_screen_pt.x() / 2.0, max_screen_pt.y() / 2.0), ) } diff --git a/editor/src/ui.rs b/editor/src/ui.rs index 530d390a55..d1ea2b40a0 100644 --- a/editor/src/ui.rs +++ b/editor/src/ui.rs @@ -72,7 +72,7 @@ impl UI { println!("Opening {}", abst_path); let data = map_model::load_pb(abst_path).expect("Couldn't load pb"); let map = map_model::Map::new(&data); - let (draw_map, _, center_pt) = render::DrawMap::new(&map); + let (draw_map, center_pt) = render::DrawMap::new(&map); let control_map = ControlMap::new(&map); let steepness_viz = SteepnessVisualizer::new(&map);