mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
Woops, fix edit mode crash from previous commit
This commit is contained in:
parent
ac3bc51af2
commit
4d6fc18c26
@ -158,6 +158,7 @@ impl TrafficSignalEditor {
|
||||
draw_signal_stage(
|
||||
ctx.prerender,
|
||||
&stage,
|
||||
self.current_stage,
|
||||
signal.id,
|
||||
None,
|
||||
&mut batch,
|
||||
@ -832,6 +833,7 @@ fn draw_multiple_signals(
|
||||
draw_signal_stage(
|
||||
ctx.prerender,
|
||||
&app.primary.map.get_traffic_signal(*i).stages[idx],
|
||||
idx,
|
||||
*i,
|
||||
None,
|
||||
&mut piece,
|
||||
|
@ -278,6 +278,7 @@ pub fn traffic_signal(
|
||||
draw_signal_stage(
|
||||
ctx.prerender,
|
||||
stage,
|
||||
idx,
|
||||
id,
|
||||
None,
|
||||
&mut orig_batch,
|
||||
|
@ -154,6 +154,7 @@ impl Renderable for DrawIntersection {
|
||||
draw_signal_stage(
|
||||
g.prerender,
|
||||
&signal.stages[idx],
|
||||
idx,
|
||||
self.id,
|
||||
Some(remaining),
|
||||
&mut batch,
|
||||
|
@ -11,6 +11,7 @@ use widgetry::{Color, GeomBatch, Line, Prerender, RewriteColor, Text};
|
||||
pub fn draw_signal_stage(
|
||||
prerender: &Prerender,
|
||||
stage: &Stage,
|
||||
idx: usize,
|
||||
i: IntersectionID,
|
||||
time_left: Option<Duration>,
|
||||
batch: &mut GeomBatch,
|
||||
@ -126,7 +127,6 @@ pub fn draw_signal_stage(
|
||||
Color::hex("#5B5B5B"),
|
||||
Circle::new(center, radius).to_polygon(),
|
||||
);
|
||||
let idx = signal.stages.iter().position(|s| s == stage).unwrap() + 1;
|
||||
batch.append(
|
||||
Text::from(Line(idx.to_string()))
|
||||
.render_to_batch(prerender)
|
||||
|
Loading…
Reference in New Issue
Block a user