mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-03-02 16:03:52 +08:00
dont show speed below zero
This commit is contained in:
@@ -306,7 +306,7 @@ static void ui_draw_vision_maxspeed(UIState *s) {
|
||||
}
|
||||
|
||||
static void ui_draw_vision_speed(UIState *s) {
|
||||
const float speed = s->scene.controls_state.getVEgo() * (s->is_metric ? 3.6 : 2.2369363);
|
||||
const float speed = std::max(0.0, s->scene.controls_state.getVEgo() * (s->is_metric ? 3.6 : 2.2369363));
|
||||
const std::string speed_str = std::to_string((int)std::nearbyint(speed));
|
||||
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
ui_draw_text(s->vg, s->scene.viz_rect.centerX(), 240, speed_str.c_str(), 96 * 2.5, COLOR_WHITE, s->font_sans_bold);
|
||||
|
||||
Reference in New Issue
Block a user