Skip to content

Commit

Permalink
Aerolab - scale x-axis distance when imperials units are used
Browse files Browse the repository at this point in the history
Also zoom to interval limits
Fixes #4074
  • Loading branch information
amtriathlon committed Nov 21, 2021
1 parent 20201c1 commit 8d3f580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Charts/Aerolab.cpp
Expand Up @@ -369,7 +369,7 @@ Aerolab::setData(RideItem *_rideItem, bool new_zoom) {
//d += v * dt;
//distanceArray[arrayLength] = d/1000;

distanceArray[arrayLength] = p1->km;
distanceArray[arrayLength] = p1->km * (GlobalContext::context()->useMetricUnits ? 1 : MILES_PER_KM);



Expand Down
5 changes: 3 additions & 2 deletions src/Charts/AerolabWindow.cpp
Expand Up @@ -26,6 +26,7 @@
#include "RideItem.h"
#include "Colors.h"
#include "HelpWhatsThis.h"
#include "Units.h"
#include <QtGui>
#include <qwt_plot_zoomer.h>

Expand Down Expand Up @@ -647,8 +648,8 @@ AerolabWindow::zoomInterval(IntervalItem *which) {
rect.setLeft(which->start/60);
rect.setRight(which->stop/60);
} else {
rect.setLeft(which->startKM);
rect.setRight(which->stopKM);
rect.setLeft(which->startKM * (GlobalContext::context()->useMetricUnits ? 1 : MILES_PER_KM));
rect.setRight(which->stopKM * (GlobalContext::context()->useMetricUnits ? 1 : MILES_PER_KM));
}
rect.setTop(aerolab->veCurve->maxYValue()*1.1);
rect.setBottom(aerolab->veCurve->minYValue()-10);
Expand Down

0 comments on commit 8d3f580

Please sign in to comment.