Mercurial > dive4elements > river
changeset 8609:421e5cceac84
(issue1754) Better fix for radius calculation then 8607:2010da0904b7
Checking for that lower < upper is guranteed in radius calculation
makes more sense to do centrally in ZoomScale. This also works
for the MINFO Filter facets.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 24 Mar 2015 11:06:47 +0100 |
parents | 0f6f702742b4 |
children | 1f6b30310360 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java Tue Mar 24 10:52:23 2015 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java Tue Mar 24 11:06:47 2015 +0100 @@ -39,11 +39,6 @@ Double start = (Double)context.getContextValue("startkm"); Double end = (Double)context.getContextValue("endkm"); if(start != null && end != null) { - if (start > end) { - Double buf = start; - start = end; - end = buf; - } RiverContext fc = (RiverContext)context.globalContext(); // Adaptive smoothing, based on zoom factor/diagram extents. ZoomScale scales = (ZoomScale)fc.get("zoomscale");
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java Tue Mar 24 10:52:23 2015 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java Tue Mar 24 11:06:47 2015 +0100 @@ -35,6 +35,11 @@ } public double getRadius(String river, double lower, double upper) { + if (lower > upper) { + double buf = lower; + lower = upper; + upper = buf; + } double range = Math.abs(upper) - Math.abs(lower); TreeMap<Double, Double> ranges = rivers.get(river); if (ranges == null) {