changeset 6049:2f50591aacc7

Add an extra class for values >= the largest class Fixes: flys/issue560
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 17 May 2013 18:21:53 +0200
parents caf9d989bd84
children 06450ef553cc
files artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Fri May 17 17:56:20 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Fri May 17 18:21:53 2013 +0200
@@ -687,6 +687,11 @@
         float gd = (endColor.getGreen() - startColor.getGreen()) / (float)numClasses;
         float bd = (endColor.getBlue()  - startColor.getBlue())  / (float)numClasses;
 
+        if (numClasses > 1) {
+            // Desktop Flys always added a last "and larger class"
+            numClasses += 1;
+        }
+
         for (int n = 0; n < numClasses; n++) {
             StringBuilder newColor = new StringBuilder();
             newColor.append(startColor.getRed()   + Math.round(n * rd));

http://dive4elements.wald.intevation.org