mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
Fix a rare crash in the new LTN cell drawing
This commit is contained in:
parent
cc9687b7d6
commit
46df90a238
@ -262,6 +262,11 @@ fn setup_editing(
|
||||
|
||||
// Highlight cell areas and their border areas when hovered
|
||||
for (idx, polygons) in render_cells.polygons_per_cell.iter().enumerate() {
|
||||
// Edge case happening near https://www.openstreetmap.org/way/106879596
|
||||
if polygons.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut batch = GeomBatch::new();
|
||||
batch.extend(Color::YELLOW.alpha(0.1), polygons.clone());
|
||||
for arrow in neighbourhood.cells[idx].border_arrows(app) {
|
||||
|
@ -10,6 +10,7 @@ use crate::{colors, Neighbourhood};
|
||||
const RESOLUTION_M: f64 = 10.0;
|
||||
|
||||
pub struct RenderCells {
|
||||
/// Rarely, this might be empty if the area is very small
|
||||
pub polygons_per_cell: Vec<Vec<Polygon>>,
|
||||
/// Colors per cell, such that adjacent cells are colored differently
|
||||
pub colors: Vec<Color>,
|
||||
|
Loading…
Reference in New Issue
Block a user