mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
handle tiny geometry in traffic signal editor, and bring in new traffic
signals
This commit is contained in:
parent
1d8ee5f2a5
commit
2b861ff667
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -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)",
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user