cabana: fix incorrect clamp (#27218)

* fix incorrect clamp

* fix type error
old-commit-hash: 4117986520e539aa2a6288538c940728ccb89884
This commit is contained in:
Dean Lee
2023-02-06 06:50:32 +08:00
committed by GitHub
parent 6bd72c1d19
commit 1958d92206
+2 -2
View File
@@ -642,8 +642,8 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) {
double max = chart()->mapToValue(rect.bottomRight()).x();
// Prevent zooming/seeking past the end of the route
min = std::clamp(min, can->routeStartTime(), can->routeStartTime() + can->totalSeconds());
max = std::clamp(max, can->routeStartTime(), can->routeStartTime() + can->totalSeconds());
min = std::clamp(min, 0., can->totalSeconds());
max = std::clamp(max, 0., can->totalSeconds());
double min_rounded = std::floor(min * 10.0) / 10.0;
double max_rounded = std::floor(max * 10.0) / 10.0;