Skip to content

Commit

Permalink
Imperial/metric conversion error
Browse files Browse the repository at this point in the history
.. in metricstrings(), asstring() and intervalstrings()
  • Loading branch information
liversedge committed Aug 16, 2021
1 parent 195514c commit e464762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Charts/OverviewItems.cpp
Expand Up @@ -5103,7 +5103,7 @@ VScrollBar::paint(QPainter*painter, const QStyleOptionGraphicsItem *, QWidget*)

painter->setBrush(barcolor);
painter->setPen(Qt::NoPen);
painter->drawRect(geom.x(), geom.y()+barpos, geom.width(), barheight);
painter->drawRoundedRect(QRectF(geom.x(), geom.y()+barpos, geom.width(), barheight), geom.width()/2, geom.width()/2);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Core/DataFilter.cpp
Expand Up @@ -3432,7 +3432,7 @@ Result Leaf::eval(DataFilterRuntime *df, Leaf *leaf, const Result &x, long it, R
// get metric value then convert to string
double value = 0;
if (c) value = RideMetric::getForSymbol(o_symbol, c);
else value = m->getForSymbol(o_symbol);
else value = m->getForSymbol(o_symbol, GlobalContext::context()->useMetricUnits);

// use metric converter to get as string with correct dp etc
list << e->toString(value);
Expand Down Expand Up @@ -4419,7 +4419,7 @@ Result Leaf::eval(DataFilterRuntime *df, Leaf *leaf, const Result &x, long it, R
value= QDate(1900,01,01).daysTo(ride->dateTime.date());
if (wantstrings) asstring = ride->dateTime.date().toString("dd MMM yyyy");
} else {
value = ride->getForSymbol(df->lookupMap.value(symbol,""));
value = ride->getForSymbol(df->lookupMap.value(symbol,""), GlobalContext::context()->useMetricUnits);
if (wantstrings) e ? asstring = e->toString(value) : "(null)";
}

Expand Down Expand Up @@ -4534,7 +4534,7 @@ Result Leaf::eval(DataFilterRuntime *df, Leaf *leaf, const Result &x, long it, R
value = ii->selected;
asstring = QString("%1").arg(ii->selected);
} else {
value = ii->getForSymbol(df->lookupMap.value(symbol,""));
value = ii->getForSymbol(df->lookupMap.value(symbol,""), GlobalContext::context()->useMetricUnits);
if (wantstrings) e ? asstring = e->toString(value) : "(null)";
}

Expand Down

0 comments on commit e464762

Please sign in to comment.