handle tiny geometry in traffic signal editor, and bring in new traffic

signals
This commit is contained in:
Dustin Carlino 2020-04-21 18:18:43 -07:00
parent 1d8ee5f2a5
commit 2b861ff667
2 changed files with 9 additions and 5 deletions

2
Cargo.lock generated
View File

@ -2660,7 +2660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "seattle_traffic_signals"
version = "0.1.0"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#75a8500a59bbaf74fb0aa08a7cad6a075472f1e9"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#e3afd88651ef379cb1dd094ab4b927a0b3083513"
dependencies = [
"include_dir 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -66,10 +66,14 @@ impl DrawTurnGroup {
.max()
.unwrap() as f64;
let (pl, width) = group.src_center_and_width(map);
let slice = pl.exact_slice(
offset * TURN_ICON_ARROW_LENGTH,
(offset + 1.0) * TURN_ICON_ARROW_LENGTH,
);
let slice = if pl.length() >= (offset + 1.0) * TURN_ICON_ARROW_LENGTH {
pl.exact_slice(
offset * TURN_ICON_ARROW_LENGTH,
(offset + 1.0) * TURN_ICON_ARROW_LENGTH,
)
} else {
pl
};
let block = slice.make_polygons(width);
let arrow = {