mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Overview - Fix up/down in Metric and RPE tiles
Add declaration for variable v inside the loop used to compute avg/min/max to avoid affecting variable v in the outer scope, this is the minimum change to fix the problem and the same pattern is present in other tiles. Without this change up/down is based on the first activity of the same sport in the previous 30 days, instead of the current one.
This commit is contained in:
@@ -518,7 +518,7 @@ RPEOverviewItem::setData(RideItem *item)
|
||||
// only activities with matching sport flags
|
||||
if (prior->isRun == item->isRun && prior->isSwim == item->isSwim) {
|
||||
|
||||
v = prior->getText("RPE", "0").toDouble();
|
||||
double v = prior->getText("RPE", "0").toDouble();
|
||||
if (std::isinf(v) || std::isnan(v)) v=0;
|
||||
|
||||
// new no zero value
|
||||
@@ -593,6 +593,8 @@ MetricOverviewItem::setData(RideItem *item)
|
||||
// only activities with matching sport flags
|
||||
if (prior->isRun == item->isRun && prior->isSwim == item->isSwim) {
|
||||
|
||||
double v;
|
||||
|
||||
if (units == tr("seconds")) v = prior->getForSymbol(symbol, GlobalContext::context()->useMetricUnits);
|
||||
else {
|
||||
QString vs = prior->getStringForSymbol(symbol, GlobalContext::context()->useMetricUnits);
|
||||
|
||||
Reference in New Issue
Block a user