[Marble-commits] KDE/kdeedu/marble/src/lib/routing/instructions

Dennis Nienhüser earthwings at gentoo.org
Thu Sep 2 23:03:22 CEST 2010


SVN commit 1171138 by nienhueser:

Round distances smaller than 1 km in turn instructions: To multipes of 50 m for distances larger than 200 m, multiples of 25 m if larger than 100 m and multipes of 10 m otherwise.
CCMAIL: tobias.jakobs at googlemail.com

 M  +6 -0      RoutingInstruction.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingInstruction.cpp #1171137:1171138
@@ -264,6 +264,12 @@
         length /= 1000;
         distanceUnit = "km";
         precision = 1;
+    } else if ( length >= 200 ) {
+        length = 50 * qRound( length / 50 );
+    } else if ( length >= 100 ) {
+        length = 25 * qRound( length / 25 );
+    } else {
+        length = 10 * qRound( length / 10 );
     }
 
     if ( length == 0 ) {


More information about the Marble-commits mailing list