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

List:       kde-commits
Subject:    branches/marble/marble-1.1/src/plugins/render/mapscale
From:       Torsten Rahn <tackat () kde ! org>
Date:       2011-01-17 23:21:44
Message-ID: 20110117232144.42D31AC8B7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1215189 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/marble/marble-1.1/src/plugins/render/mapscale/MapScaleFloatItem.cpp #1215188:1215189
@@ -252,7 +252,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() );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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