JAL-3444 transparent colour for alignment in JS
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 3 Oct 2019 12:39:28 +0000 (13:39 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 3 Oct 2019 12:39:28 +0000 (13:39 +0100)
src/jalview/renderer/seqfeatures/FeatureColourFinder.java

index b92d57b..ee40d83 100644 (file)
@@ -28,7 +28,6 @@ import jalview.viewmodel.seqfeatures.FeatureRendererModel;
 
 import java.awt.Color;
 import java.awt.Graphics;
-import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 
 /**
@@ -114,8 +113,17 @@ 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();
+      }
       c = new Color(offscreenImage.getRGB(0, 0));
     }
+
     return c;
   }