From 1d755855936eeb33517ba8df84cf42c1d51112ce Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Fri, 13 Sep 2019 12:48:39 +1000 Subject: [PATCH] Still allow header to be displayed when dragon_driving_ui is disabled --- selfdrive/ui/ui.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index ede6f75f8..ab70678f9 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -1415,16 +1415,16 @@ static void ui_draw_vision_header(UIState *s) { const UIScene *scene = &s->scene; int ui_viz_rx = scene->ui_viz_rx; int ui_viz_rw = scene->ui_viz_rw; - - nvgBeginPath(s->vg); - NVGpaint gradient = nvgLinearGradient(s->vg, ui_viz_rx, - (box_y+(header_h-(header_h/2.5))), - ui_viz_rx, box_y+header_h, - nvgRGBAf(0,0,0,0.45), nvgRGBAf(0,0,0,0)); - nvgFillPaint(s->vg, gradient); - nvgRect(s->vg, ui_viz_rx, box_y, ui_viz_rw, header_h); - nvgFill(s->vg); - + if (s->dragon_driving_ui) { + nvgBeginPath(s->vg); + NVGpaint gradient = nvgLinearGradient(s->vg, ui_viz_rx, + (box_y+(header_h-(header_h/2.5))), + ui_viz_rx, box_y+header_h, + nvgRGBAf(0,0,0,0.45), nvgRGBAf(0,0,0,0)); + nvgFillPaint(s->vg, gradient); + nvgRect(s->vg, ui_viz_rx, box_y, ui_viz_rw, header_h); + nvgFill(s->vg); + } if (s->dragon_ui_maxspeed) { ui_draw_vision_maxspeed(s); } @@ -1832,10 +1832,10 @@ static void ui_draw_vision(UIState *s) { } nvgRestore(s->vg); - if (s->dragon_driving_ui) { - // Set Speed, Current Speed, Status/Events - ui_draw_vision_header(s); - } + + // Set Speed, Current Speed, Status/Events + ui_draw_vision_header(s); + if (s->scene.alert_size != ALERTSIZE_NONE) { // Controls Alerts ui_draw_vision_alert(s, s->scene.alert_size, s->status,