From 1648150f514f5286051abdc1787009e1ec374154 Mon Sep 17 00:00:00 2001 From: hansonr Date: Thu, 10 Oct 2019 14:41:27 +0200 Subject: [PATCH] JAL-3444 translucent overview - was missing 2nd isJS block - JS was setting pixel background to white instead of defaultColour prior to transparent color painting --- src/jalview/renderer/seqfeatures/FeatureColourFinder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java index ee40d83..836bc4a 100644 --- a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java +++ b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java @@ -98,11 +98,17 @@ public class FeatureColourFinder */ if (featureRenderer.getTransparency() != 1f) { - g = goff; - if (defaultColour != null) + Color c = (defaultColour == null ? Color.white : defaultColour); + if (Platform.isJS()) { - offscreenImage.setRGB(0, 0, defaultColour.getRGB()); + g = goff; + // Clear the HTML5 canvas color. + // otherwise we get a smearing. + // For whatever reason, this is necessary BH 2019.10.01. + g.setColor(c); + g.fillRect(0, 0, 1, 1); } + offscreenImage.setRGB(0, 0, c.getRGB()); } Color c = featureRenderer.findFeatureColour(seq, column + 1, g); -- 1.7.10.2