diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index c62880e..2c278b3 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -874,8 +874,8 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { acceleration.push_back(acceleration_const[i]); } - try { - for (int i = 0; i < max_len; ++i) { + try { + for (int i = 0; i < max_len; ++i) { if (scene.track_vertices[i].y() < 0 || scene.track_vertices[i].y() > height()) continue; float lin_grad_point = (height() - scene.track_vertices[i].y()) / height(); @@ -892,8 +892,9 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { QColor final_color = QColor::fromHslF(static_cast(_h / 360.f), adjusted_saturation, adjusted_lightness, dynamic_alpha); bg.setColorAt(lin_grad_point, final_color); + + i += (i + 2) < max_len ? 1 : 0; // Skipping a point to optimize rendering } - i += (i + 2) < max_len ? 1 : 0; // Skipping a point to optimize rendering } } catch () { // Default shading if for some reason the above code fails