From: hansonr Date: Tue, 15 Oct 2019 15:54:53 +0000 (-0500) Subject: Commit 113cc13-2019.09.28 with added transparency fix X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5e37267b48b75b90d264e7ab04ae1bc4a0155e3e;p=jalview.git Commit 113cc13-2019.09.28 with added transparency fix --- diff --git a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java index 8da880a..136404b 100644 --- a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java +++ b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java @@ -23,6 +23,7 @@ package jalview.renderer.seqfeatures; import jalview.api.FeatureRenderer; import jalview.api.FeaturesDisplayedI; import jalview.datamodel.SequenceI; +import jalview.util.Platform; import jalview.viewmodel.seqfeatures.FeatureRendererModel; import java.awt.Color; @@ -134,10 +135,16 @@ public class FeatureColourFinder if (featureRenderer.getTransparency() != 1f) { g = goff; - if (defaultColour != 0) + int c = (defaultColour == 0 ? -1 : defaultColour); + if (Platform.isJS()) { - offscreenImage.setRGB(0, 0, defaultColour); + // Clear the HTML5 canvas color. + // otherwise we get a smearing. + // For whatever reason, this is necessary BH 2019.10.01. + g.setColor(new Color(c)); + g.fillRect(0, 0, 1, 1); } + offscreenImage.setRGB(0, 0, c); } Color c = featureRenderer.findFeatureColour(seq, column + 1, g); @@ -148,6 +155,12 @@ public class FeatureColourFinder if (g != null) { + if (Platform.isJS()) + { + // for JavaScript the pixel itself + // is a resource that needs to be recreated in getRGB(0,0) + offscreenImage.flush(); + } return offscreenImage.getRGB(0, 0); } return c.getRGB(); diff --git a/swingjs/SwingJS-site.zip b/swingjs/SwingJS-site.zip index fb1171f..dfbfff9 100644 Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ diff --git a/swingjs/_j2sclasslist.txt b/swingjs/_j2sclasslist.txt index 3bbf460..e35111e 100644 --- a/swingjs/_j2sclasslist.txt +++ b/swingjs/_j2sclasslist.txt @@ -391,3 +391,5 @@ swingjs/plaf/JSWindowUI.js swingjs/plaf/LazyActionMap.js swingjs/plaf/Resizer.js swingjs/plaf/TextListener.js + + diff --git a/swingjs/net.sf.j2s.core.jar b/swingjs/net.sf.j2s.core.jar index 87df1d9..e8288a9 100644 Binary files a/swingjs/net.sf.j2s.core.jar and b/swingjs/net.sf.j2s.core.jar differ diff --git a/swingjs/timestamp b/swingjs/timestamp index b1b321a..29c8291 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20190826121833 +20191015091530 diff --git a/swingjs/ver/3.2.4/SwingJS-site.zip b/swingjs/ver/3.2.4/SwingJS-site.zip index fb1171f..dfbfff9 100644 Binary files a/swingjs/ver/3.2.4/SwingJS-site.zip and b/swingjs/ver/3.2.4/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.4/_j2sclasslist.txt b/swingjs/ver/3.2.4/_j2sclasslist.txt index 3bbf460..e35111e 100644 --- a/swingjs/ver/3.2.4/_j2sclasslist.txt +++ b/swingjs/ver/3.2.4/_j2sclasslist.txt @@ -391,3 +391,5 @@ swingjs/plaf/JSWindowUI.js swingjs/plaf/LazyActionMap.js swingjs/plaf/Resizer.js swingjs/plaf/TextListener.js + + diff --git a/swingjs/ver/3.2.4/net.sf.j2s.core.jar b/swingjs/ver/3.2.4/net.sf.j2s.core.jar index 87df1d9..e8288a9 100644 Binary files a/swingjs/ver/3.2.4/net.sf.j2s.core.jar and b/swingjs/ver/3.2.4/net.sf.j2s.core.jar differ diff --git a/swingjs/ver/3.2.4/timestamp b/swingjs/ver/3.2.4/timestamp index b1b321a..29c8291 100644 --- a/swingjs/ver/3.2.4/timestamp +++ b/swingjs/ver/3.2.4/timestamp @@ -1 +1 @@ -20190826121833 +20191015091530