JAL-1958 use the annotation score for the sequence being coloured !
[jalview.git] / src / jalview / schemes / AnnotationColourGradient.java
index 3ed18bf..7133f13 100755 (executable)
@@ -247,6 +247,10 @@ public class AnnotationColourGradient extends FollowerColourScheme
         perLineScore = plcount == ancount;
         aamax=plmax;
       }
+      else
+      {
+        perLineScore = false;
+      }
       if (rna)
       {
         ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
@@ -480,12 +484,12 @@ public class AnnotationColourGradient extends FollowerColourScheme
     if (perLineScore)
     {
       trans = (int) ((1f - range) * midtr);
-      range = (float) ((annotation.score - plmin) / (plmax - aamin));
+      range = (float) ((ann.score - plmin) / (plmax - aamin));
     }
     int dr = (int) (redRange * range + redMin),
             dg = (int) (greenRange * range + greenMin),
             db = (int) (blueRange * range + blueMin);
-    if (annotation.score == annotation.score && positionToTransparency)
+    if (ann.score == ann.score && positionToTransparency)
     {
       return new Color(Math.min(dr + trans, midtr), Math.min(dg
               + trans, midtr), Math.min(db + trans, midtr));