stop drawing text labels on lanes

This commit is contained in:
Dustin Carlino 2018-09-07 15:13:06 -07:00
parent 87a33a6c78
commit 3cff2cecd7
2 changed files with 14 additions and 9 deletions

View File

@ -91,7 +91,7 @@ impl DrawLane {
g.draw_polygon(color, &self.polygon);
}
pub fn draw_detail(&self, g: &mut GfxCtx, canvas: &Canvas, cs: &ColorScheme) {
pub fn draw_detail(&self, g: &mut GfxCtx, cs: &ColorScheme) {
for m in &self.markings {
let line = if m.round {
graphics::Line::new_round(cs.get(m.color), m.thickness)
@ -102,14 +102,15 @@ impl DrawLane {
g.draw_line(&line, *pts);
}
}
// TODO move to draw_debug
for pt in &self.draw_id_at {
canvas.draw_text_at(g, &vec![format!("{}", self.id.0)], pt.x(), pt.y());
}
}
pub fn draw_debug(&self, g: &mut GfxCtx, cs: &ColorScheme, l: &map_model::Lane) {
pub fn draw_debug(
&self,
g: &mut GfxCtx,
canvas: &Canvas,
cs: &ColorScheme,
l: &map_model::Lane,
) {
let line =
graphics::Line::new_round(cs.get(Colors::Debug), PARCEL_BOUNDARY_THICKNESS / 2.0);
let circle_color = cs.get(Colors::BrightDebug);
@ -120,6 +121,10 @@ impl DrawLane {
g.draw_ellipse(circle_color, geometry::make_circle(pt1, 0.4));
g.draw_ellipse(circle_color, geometry::make_circle(pt2, 0.8));
}
for pt in &self.draw_id_at {
canvas.draw_text_at(g, &vec![format!("{}", self.id.0)], pt.x(), pt.y());
}
}
pub fn get_bbox_for_lane(&self) -> Rect {

View File

@ -649,10 +649,10 @@ impl gui::GUI for UI {
for l in &lanes_onscreen {
l.draw(g, self.color_lane(l.id));
if self.canvas.cam_zoom >= MIN_ZOOM_FOR_LANE_MARKERS {
l.draw_detail(g, &self.canvas, &self.cs);
l.draw_detail(g, &self.cs);
}
if self.debug_mode.is_enabled() {
l.draw_debug(g, &self.cs, self.map.get_l(l.id));
l.draw_debug(g, &self.canvas, &self.cs, self.map.get_l(l.id));
}
}