Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java @ 2623:c4591312f3d3
Fixed step calculation in W/Q range input mode.
flys-artifacts/trunk@4209 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 11 Apr 2012 09:17:03 +0000 |
parents | 3a93bbbe2ec7 |
children | 8e66293c5369 |
comparison
equal
deleted
inserted
replaced
2622:8bc1e1cb7f7b | 2623:c4591312f3d3 |
---|---|
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 | 344 |
345 protected static double getSteps(double steps, double factor) { | 345 protected static double getSteps(double steps, double factor) { |
346 int fac = (int) steps / 10; | 346 int fac = (int) (steps / factor); |
347 double diff = steps - fac * 10; | 347 double diff = steps - fac * factor; |
348 | 348 |
349 if (diff == 0) { | 349 if (diff == 0) { |
350 return steps; | 350 return steps; |
351 } | 351 } |
352 | 352 |
353 return 10d * (fac + 1); | 353 return factor * (fac + 1); |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { | 357 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { |
358 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); | 358 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); |