Merge branch 'bug/JAL-2791exportFilteredFeature' into merge/JAL-2791
[jalview.git] / src / jalview / viewmodel / seqfeatures / FeatureRendererModel.java
index 2aadee4..4af6fde 100644 (file)
@@ -1029,11 +1029,11 @@ public abstract class FeatureRendererModel
   }
 
   /**
-   * Removes from the list of features any that duplicate the location of a
-   * feature of the same type. Should be used only for features of the same,
-   * simple, feature colour (which normally implies the same feature type). Does
-   * not check visibility settings for feature type or feature group. No
-   * filtering is done if transparency, or any feature filters, are in force.
+   * Removes from the list of features any whose group is not shown, or that are
+   * visible and duplicate the location of a visible feature of the same type.
+   * Should be used only for features of the same, simple, feature colour (which
+   * normally implies the same feature type). No filtering is done if
+   * transparency, or any feature filters, are in force.
    * 
    * @param features
    */
@@ -1057,6 +1057,11 @@ public abstract class FeatureRendererModel
     while (it.hasNext())
     {
       SequenceFeature sf = it.next();
+      if (featureGroupNotShown(sf))
+      {
+        it.remove();
+        continue;
+      }
 
       /*
        * a feature is redundant for rendering purposes if it has the
@@ -1064,7 +1069,8 @@ public abstract class FeatureRendererModel
        * (checking type and isContactFeature as a fail-safe here, although
        * currently they are guaranteed to match in this context)
        */
-      if (lastFeature != null && sf.getBegin() == lastFeature.getBegin()
+      if (lastFeature != null
+              && sf.getBegin() == lastFeature.getBegin()
               && sf.getEnd() == lastFeature.getEnd()
               && sf.isContactFeature() == lastFeature.isContactFeature()
               && sf.getType().equals(lastFeature.getType()))