[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.6/kdeedu/marble/src/plugins/render/mapscale
From: Torsten Rahn <tackat () kde ! org>
Date: 2011-01-17 23:21:09
Message-ID: 20110117232109.64603AC8B6 () svn ! kde ! org
[Download RAW message or body]
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() );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic