mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-23 17:07:12 +03:00
Draw disconnected cells as red, to shout 'problem'
This commit is contained in:
parent
c3b74d1358
commit
5f3bb8897d
@ -77,7 +77,6 @@ impl Viewer {
|
||||
.iter()
|
||||
.filter(|c| c.is_disconnected())
|
||||
.count();
|
||||
// TODO Also add a red outline to them or something
|
||||
let warning = if disconnected_cells == 0 {
|
||||
String::new()
|
||||
} else {
|
||||
|
@ -18,6 +18,7 @@ lazy_static::lazy_static! {
|
||||
];
|
||||
}
|
||||
const CAR_FREE_COLOR: Color = Color::GREEN;
|
||||
const DISCONNECTED_COLOR: Color = Color::RED;
|
||||
|
||||
/// Partition a neighborhood's boundary polygon based on the cells. Currently this discretizes
|
||||
/// space into a grid, so the results don't look perfect, but it's fast. Also returns the color for
|
||||
@ -83,6 +84,8 @@ pub fn draw_cells(map: &Map, neighborhood: &Neighborhood) -> (GeomBatch, Vec<Col
|
||||
for (idx, cell) in neighborhood.cells.iter().enumerate() {
|
||||
if cell.car_free {
|
||||
cell_colors[idx] = CAR_FREE_COLOR;
|
||||
} else if cell.is_disconnected() {
|
||||
cell_colors[idx] = DISCONNECTED_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user