onroad UI: show negative speed (#23987)

* show negative speed

* remove ()
pull/23983/head^2
Igor Biletskyy 2022-03-17 13:17:33 -07:00 committed by GitHub
parent 5bc47a294f
commit 62087a6368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ void OnroadHud::updateState(const UIState &s) {
maxspeed *= KM_TO_MILE;
}
QString maxspeed_str = cruise_set ? QString::number(std::nearbyint(maxspeed)) : "N/A";
float cur_speed = std::max(0.0, sm["carState"].getCarState().getVEgo() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH));
float cur_speed = sm["carState"].getCarState().getVEgo() * (s.scene.is_metric ? MS_TO_KPH : MS_TO_MPH);
setProperty("is_cruise_set", cruise_set);
setProperty("speed", QString::number(std::nearbyint(cur_speed)));