cabana: fix chart range not updated when replay is seeking back. (#27036)

pull/27046/head
Dean Lee 2 years ago committed by GitHub
parent 1e4721ad62
commit a0f91b0a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/cabana/chartswidget.cc

@ -135,7 +135,7 @@ void ChartsWidget::updateState() {
const double cur_sec = can->currentSec();
if (!is_zoomed) {
double pos = (cur_sec - display_range.first) / max_chart_range;
if (pos > 0.8) {
if (pos < 0 || pos > 0.8) {
const double min_event_sec = (can->events()->front()->mono_time / (double)1e9) - can->routeStartTime();
display_range.first = std::floor(std::max(min_event_sec, cur_sec - max_chart_range * 0.2));
}

Loading…
Cancel
Save