[Dive4elements-commits] [PATCH] Add an extra class for values >= the largest class
Wald Commits
scm-commit at wald.intevation.org
Fri May 17 18:22:00 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1368807713 -7200
# Node ID 2f50591aacc7765f503b4a59839b9888c10cbe15
# Parent caf9d989bd84d23574398ce2ac4e577e3efa486f
Add an extra class for values >= the largest class
Fixes: flys/issue560
diff -r caf9d989bd84 -r 2f50591aacc7 artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java
--- 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));
More information about the Dive4elements-commits
mailing list