diff --git a/src/Metrics/PeakHr.cpp b/src/Metrics/PeakHr.cpp index 5165597aa..35a7b3bdb 100644 --- a/src/Metrics/PeakHr.cpp +++ b/src/Metrics/PeakHr.cpp @@ -82,7 +82,7 @@ class HrZone : public RideMetric { // use MaxHr as upper bound, this is used // for the limit of upper zone ALWAYS const int pmax = zones->getMaxHr(item->hrZoneRange); - high = std::max(high, pmax); + high = std::min(high, pmax); // how far in? percent = double(ahr-low) / double(high-low); diff --git a/src/Metrics/PeakPower.cpp b/src/Metrics/PeakPower.cpp index 9427de851..93835060f 100644 --- a/src/Metrics/PeakPower.cpp +++ b/src/Metrics/PeakPower.cpp @@ -99,12 +99,10 @@ class PeakPercent : public RideMetric { class PowerZone : public RideMetric { Q_DECLARE_TR_FUNCTIONS(PowerZone) - double maxp; - double minp; public: - PowerZone() : maxp(0.0), minp(10000) + PowerZone() { setType(RideMetric::Average); setSymbol("power_zone"); @@ -153,7 +151,7 @@ class PowerZone : public RideMetric { // use Pmax as upper bound, this is used // for the limit of upper zone ALWAYS const int pmax = zones->getPmax(item->zoneRange); - high = std::max(high, pmax); + high = std::min(high, pmax); // how far in? percent = double(ap-low) / double(high-low);