- Color featureColour = fc.getColor(sf);
- int visibleStart = Math.max(sf.getBegin(),
- visiblePositions.getBegin());
+ SequenceFeature sf = overlaps.get(i);
+ Color featureColour = getColor(sf, fc);
+ if (featureColour == null)
+ {
+ /*
+ * feature excluded by visibility settings, filters, or colour threshold
+ */
+ continue;
+ }
+
+ /*
+ * if feature starts/ends outside the visible range,
+ * restrict to visible positions (or if a contact feature,
+ * to a single position)
+ */
+ int sf0 = sf.getBegin();
+ int sf1 = sf.getEnd();
+ int visibleStart = sf0;
+ if (visibleStart < vp0)
+ {
+ visibleStart = sf.isContactFeature() ? sf1 : vp0;
+ }
+ int visibleEnd = sf1;
+ if (visibleEnd > vp1)
+ {
+ visibleEnd = sf.isContactFeature() ? sf0 : vp1;
+ }
+