[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/plugins/render/mapscale
Torsten Rahn
tackat at kde.org
Tue Jan 18 00:21:09 CET 2011
SVN commit 1215188 by rahn:
Backport:
rahn * r1215182
trunk/KDE/kdeedu/marble/src/plugins/render/mapscale/MapScaleFloatItem.cpp
- Hotfix for the mile 0-precision bug of the scale bar
reported by Mustali Dalal:
Unfortunately using "feet" instead of "miles" for
low values is not trivial, so we use floating point
representation for values close to 0.
M +7 -0 MapScaleFloatItem.cpp
--- branches/KDE/4.6/kdeedu/marble/src/plugins/render/mapscale/MapScaleFloatItem.cpp #1215187:1215188
@@ -193,7 +193,14 @@
else {
m_unit = "mi";
intervalStr.setNum( j * m_valueInterval / 1000 );
+
+ if ( m_bestDivisor * m_valueInterval > 3800 ) {
+ intervalStr.setNum( j * m_valueInterval / 1000 );
}
+ else {
+ intervalStr.setNum( qreal(j * m_valueInterval ) / 1000.0, 'f', 2 );
+ }
+ }
painter->setFont( font() );
More information about the Marble-commits
mailing list