JAL-2438 clarify code and javadoc, reinstate updateFeatures() check
[jalview.git] / src / jalview / renderer / seqfeatures / FeatureRenderer.java
index 49b98a5..02cfd05 100644 (file)
@@ -255,10 +255,17 @@ public class FeatureRenderer extends FeatureRendererModel
     Color renderedColour = null;
     if (transparency == 1.0f)
     {
+      /*
+       * simple case - just find the topmost rendered visible feature colour
+       */
       renderedColour = findFeatureColour(seq, seq.findPosition(column));
     }
     else
     {
+      /*
+       * transparency case - draw all visible features in render order to
+       * build up a composite colour on the graphics context
+       */
       renderedColour = drawSequence(g, lastSeq, column, column, 0, true);
     }
     return renderedColour;
@@ -464,7 +471,10 @@ public class FeatureRenderer extends FeatureRendererModel
       return null;
     }
   
-    // updateFeatures();
+    /*
+     * check for new feature added while processing
+     */
+    updateFeatures();
 
     /*
      * inspect features in reverse renderOrder (the last in the array is 
@@ -491,6 +501,10 @@ public class FeatureRenderer extends FeatureRendererModel
           continue;
         }
 
+        /*
+         * check the column position is within the feature range
+         * (or is one of the two contact positions for a contact feature)
+         */
         boolean featureIsAtPosition = sequenceFeature.begin <= pos
                 && sequenceFeature.end >= pos;
         if (sequenceFeature.isContactFeature())