Woops, fix edit mode crash from previous commit

This commit is contained in:
Dustin Carlino 2020-09-14 18:06:25 -07:00
parent ac3bc51af2
commit 4d6fc18c26
4 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -278,6 +278,7 @@ pub fn traffic_signal(
draw_signal_stage(
ctx.prerender,
stage,
idx,
id,
None,
&mut orig_batch,

View File

@ -154,6 +154,7 @@ impl Renderable for DrawIntersection {
draw_signal_stage(
g.prerender,
&signal.stages[idx],
idx,
self.id,
Some(remaining),
&mut batch,

View File

@ -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)