[Marble-commits] KDE/kdeedu/marble/src/plugins/render/mapscale

Torsten Rahn tackat at kde.org
Mon Jan 17 23:54:26 CET 2011


SVN commit 1215182 by rahn:

- 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  +8 -1      MapScaleFloatItem.cpp  


--- trunk/KDE/kdeedu/marble/src/plugins/render/mapscale/MapScaleFloatItem.cpp #1215181:1215182
@@ -249,9 +249,16 @@
                 }
             }
             else {
-                m_unit = "mi";
+                m_unit = tr("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