Commit 113cc13-2019.09.28 with added transparency fix
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 15 Oct 2019 15:54:53 +0000 (10:54 -0500)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Tue, 15 Oct 2019 15:54:53 +0000 (10:54 -0500)
src/jalview/renderer/seqfeatures/FeatureColourFinder.java
swingjs/SwingJS-site.zip
swingjs/_j2sclasslist.txt
swingjs/net.sf.j2s.core.jar
swingjs/timestamp
swingjs/ver/3.2.4/SwingJS-site.zip
swingjs/ver/3.2.4/_j2sclasslist.txt
swingjs/ver/3.2.4/net.sf.j2s.core.jar
swingjs/ver/3.2.4/timestamp

index 8da880a..136404b 100644 (file)
@@ -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();
index fb1171f..dfbfff9 100644 (file)
Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ
index 3bbf460..e35111e 100644 (file)
@@ -391,3 +391,5 @@ swingjs/plaf/JSWindowUI.js
 swingjs/plaf/LazyActionMap.js
 swingjs/plaf/Resizer.js
 swingjs/plaf/TextListener.js
+
+
index 87df1d9..e8288a9 100644 (file)
Binary files a/swingjs/net.sf.j2s.core.jar and b/swingjs/net.sf.j2s.core.jar differ
index b1b321a..29c8291 100644 (file)
@@ -1 +1 @@
-20190826121833 
+20191015091530 
index fb1171f..dfbfff9 100644 (file)
Binary files a/swingjs/ver/3.2.4/SwingJS-site.zip and b/swingjs/ver/3.2.4/SwingJS-site.zip differ
index 3bbf460..e35111e 100644 (file)
@@ -391,3 +391,5 @@ swingjs/plaf/JSWindowUI.js
 swingjs/plaf/LazyActionMap.js
 swingjs/plaf/Resizer.js
 swingjs/plaf/TextListener.js
+
+
index 87df1d9..e8288a9 100644 (file)
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
index b1b321a..29c8291 100644 (file)
@@ -1 +1 @@
-20190826121833 
+20191015091530