Skip to content

Commit c102337

Browse files
deanleepfeiferj
authored andcommitted
cabana: fix incorrect clamp (commaai#27218)
* fix incorrect clamp * fix type error
1 parent a00331b commit c102337

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/cabana/chartswidget.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) {
642642
double max = chart()->mapToValue(rect.bottomRight()).x();
643643

644644
// Prevent zooming/seeking past the end of the route
645-
min = std::clamp(min, can->routeStartTime(), can->routeStartTime() + can->totalSeconds());
646-
max = std::clamp(max, can->routeStartTime(), can->routeStartTime() + can->totalSeconds());
645+
min = std::clamp(min, 0., can->totalSeconds());
646+
max = std::clamp(max, 0., can->totalSeconds());
647647

648648
double min_rounded = std::floor(min * 10.0) / 10.0;
649649
double max_rounded = std::floor(max * 10.0) / 10.0;

0 commit comments

Comments
 (0)