From 98f79c0c1fc3cdc48d4a10bd11f879e721b2dada Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 2 May 2024 23:12:50 -0500 Subject: [PATCH] wip --- selfdrive/ui/qt/onroad.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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