Merge branch 'develop' into features/JAL-2446NCList
[jalview.git] / src / jalview / renderer / seqfeatures / FeatureRenderer.java
index 3f44bcc..d661915 100644 (file)
@@ -309,6 +309,11 @@ public class FeatureRenderer extends FeatureRendererModel
       for (SequenceFeature sf : overlaps)
       {
         Color featureColour = fc.getColor(sf);
+        if (featureColour == null)
+        {
+          // score feature outwith threshold for colouring
+          continue;
+        }
 
         /*
          * if feature starts/ends outside the visible range,
@@ -332,7 +337,11 @@ public class FeatureRenderer extends FeatureRendererModel
         int featureEndCol = sf.begin == sf.end ? featureStartCol : seq
                 .findIndex(visibleEnd);
 
-        if (sf.isContactFeature())
+        // Color featureColour = getColour(sequenceFeature);
+
+        boolean isContactFeature = sf.isContactFeature();
+
+        if (isContactFeature)
         {
           boolean drawn = renderFeature(g, seq, featureStartCol - 1,
                   featureStartCol - 1, featureColour, start, end, y1,
@@ -345,7 +354,7 @@ public class FeatureRenderer extends FeatureRendererModel
             drawnColour = featureColour;
           }
         }
-        else if (showFeature(sf))
+        else
         {
           /*
            * showing feature score by height of colour
@@ -443,7 +452,11 @@ public class FeatureRenderer extends FeatureRendererModel
       {
         if (!featureGroupNotShown(sequenceFeature))
         {
-          return getColour(sequenceFeature);
+          Color col = getColour(sequenceFeature);
+          if (col != null)
+          {
+            return col;
+          }
         }
       }
     }