changeset 9576:c5c53e52f190

area pattern transparency sinfo tkh
author gernotbelger
date Wed, 07 Nov 2018 14:23:47 +0100
parents cff7636035ce
children ca19b7186294
files artifacts/src/main/java/org/dive4elements/river/jfree/ColorMapper.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/ColorMapper.java	Wed Nov 07 10:22:24 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/ColorMapper.java	Wed Nov 07 14:23:47 2018 +0100
@@ -28,14 +28,17 @@
     public int[] lookupPixel(final int[] src, final int[] dest) {
         final int[] out = dest == null ? new int[src.length] : dest;
 
-        // REMARK: only compare rgb, so we even keep the transparency level
-        if (src[0] == this.from[0] && src[1] == this.from[1] && src[2] == this.from[2]) {
+        // REMARK: only check opacity, because the transparency of the pattern-images is not 100% good
+        if (src[3] > 128) {
             out[0] = this.to[0];
             out[1] = this.to[1];
             out[2] = this.to[2];
-            out[3] = src[3];
+            out[3] = this.to[3];
         } else {
-            System.arraycopy(src, 0, out, 0, src.length);
+            out[0] = 0;
+            out[1] = 0;
+            out[2] = 0;
+            out[3] = 0;
         }
 
         return out;

http://dive4elements.wald.intevation.org