[PATCH] area pattern transparency sinfo tkh
Wald Commits
scm-commit at wald.intevation.org
Wed Nov 7 14:24:19 CET 2018
# HG changeset patch
# User gernotbelger
# Date 1541597027 -3600
# Node ID c5c53e52f19039ee5965f4b2a89e96923474b2e1
# Parent cff7636035ce7cb7c8146a8ff7e493aa3efb40c4
area pattern transparency sinfo tkh
diff -r cff7636035ce -r c5c53e52f190 artifacts/src/main/java/org/dive4elements/river/jfree/ColorMapper.java
--- 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;
More information about the Dive4Elements-commits
mailing list