# HG changeset patch
# User Raimund Renkert <raimund.renkert@intevation.de>
# Date 1334135823 0
# Node ID c4591312f3d3d1a30e85ff5295132e61aa16f940
# Parent  8bc1e1cb7f7ba8b4f61680456cd9ae3c0b328d8f
Fixed step calculation in W/Q range input mode.



flys-artifacts/trunk@4209 c6561f87-3c4e-4783-a992-168aeb5c3f6f

diff -r 8bc1e1cb7f7b -r c4591312f3d3 flys-artifacts/ChangeLog
--- a/flys-artifacts/ChangeLog	Fri Apr 06 10:12:34 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Apr 11 09:17:03 2012 +0000
@@ -1,3 +1,8 @@
+2012-04-11  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/WQSelect.java:
+	  Use factor to calculate steps in range input mode.
+
 2012-04-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* doc/conf/cache.xml: Increased number of fixings columns a bit.
diff -r 8bc1e1cb7f7b -r c4591312f3d3 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Fri Apr 06 10:12:34 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Wed Apr 11 09:17:03 2012 +0000
@@ -343,14 +343,14 @@
 
 
     protected static double getSteps(double steps, double factor) {
-        int    fac  = (int) steps / 10;
-        double diff = steps - fac * 10;
+        int    fac  = (int) (steps / factor);
+        double diff = steps - fac * factor;
 
         if (diff == 0) {
             return steps;
         }
 
-        return 10d * (fac + 1);
+        return factor * (fac + 1);
     }