JAL-1950 JAL-1958 disable per-row score modulation if none present
[jalview.git] / src / jalview / schemes / AnnotationColourGradient.java
index f646963..00744c0 100755 (executable)
@@ -197,7 +197,7 @@ public class AnnotationColourGradient extends FollowerColourScheme
       }
       else
       {
-        seqannot = new IdentityHashMap<SequenceI, AlignmentAnnotation>();
+        seqannot = new IdentityHashMap<>();
       }
       // resolve the context containing all the annotation for the sequence
       AnnotatedCollectionI alcontext = alignment instanceof AlignmentI
@@ -247,6 +247,10 @@ public class AnnotationColourGradient extends FollowerColourScheme
         perLineScore = plcount == ancount;
         aamax=plmax;
       }
+      else
+      {
+        perLineScore = false;
+      }
       if (rna)
       {
         ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
@@ -482,8 +486,9 @@ public class AnnotationColourGradient extends FollowerColourScheme
       trans = (int) ((1f - range) * midtr);
       range = (float) ((annotation.score - plmin) / (plmax - aamin));
     }
-    int dr = (int) (rr * range + r1), dg = (int) (gg * range + g1), db = (int) (bb
-            * range + b1);
+    int dr = (int) (redRange * range + redMin),
+            dg = (int) (greenRange * range + greenMin),
+            db = (int) (blueRange * range + blueMin);
     if (annotation.score == annotation.score && positionToTransparency)
     {
       return new Color(Math.min(dr + trans, midtr), Math.min(dg