Commit e27a5ebb authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Some qBound vs. qreal fixes

REVIEW: 125996
parent c10496a5
......@@ -58,7 +58,7 @@ private:
void makePinch(QPointF center, Qt::GestureState state, qreal scale = 1)
{
scale = sqrt(sqrt(scale));
scale = qBound(0.5, scale, 2.0);
scale = qBound(static_cast<qreal>(0.5), scale, static_cast<qreal>(2.0));
pinch(center, scale, state);
}
};
......
......@@ -496,7 +496,7 @@ namespace Marble
void MarbleQuickItem::handlePinchUpdated(const QPointF &point, qreal scale)
{
scale = sqrt(sqrt(scale));
scale = qBound(0.5, scale, 2.0);
scale = qBound(static_cast<qreal>(0.5), scale, static_cast<qreal>(2.0));
pinch(point, scale, Qt::GestureUpdated);
}
......
......@@ -127,8 +127,8 @@ void OsmWay::create(GeoDataDocument *document, const OsmNodes &nodes) const
} else if (placemark->visualCategory() == GeoDataFeature::NaturalWater) {
QString const widthValue = m_osmData.tagValue("width").replace(" meters", QString()).replace(" m", QString());
bool ok;
qreal const width = widthValue.toFloat(&ok);
lineStyle.setPhysicalWidth(ok ? qBound(0.1, width, 200.0) : 0.0);
float const width = widthValue.toFloat(&ok);
lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f);
}
GeoDataStyle::Ptr style(new GeoDataStyle(*placemark->style()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment