[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/plugins/render/mapscale
From:       Torsten Rahn <tackat () kde ! org>
Date:       2011-01-17 22:54:26
Message-ID: 20110117225426.6F15AAC8B6 () svn ! kde ! org
[Download RAW message or body]

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() );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic