avoid crash in minimap
@@ -125,6 +125,7 @@ impl Minimap {
clamp(pt.y(), 0.0, bounds.max_y),
)
};
+ if x1 != x2 && y1 != y2 {
g.draw_polygon(
Color::RED,
&Ring::new(vec![
@@ -136,6 +137,10 @@ impl Minimap {
])
.make_polygons(Distance::meters(20.0)),
);
+ } else {
+ // TODO Happens when we're quite out-of-bounds. Maybe stop allowing this at all?
+ println!("Warning: Minimap cursor is just a point right now");
+ }
g.unfork();
}
}
