int fstart = seq.findIndex(sf.getStart())-1;\r
int fend = seq.findIndex(sf.getEnd())-1;\r
\r
- if( (fstart>=start&&fstart<=end) || (fend>=start&&fend<=end))\r
+ if( (fstart<=end && fend>=start) )\r
{\r
+ if(fstart<0) // fix for if the feature we have starts before the sequence start,\r
+ fstart = 0;// but the feature end is still valid!!\r
+\r
if(fstart==fend)\r
{\r
g.setColor(Color.red);\r
{\r
for (int i = fstart; i <= fend; i++)\r
{\r
- g.setColor(Color.blue);\r
+ try{\r
+ g.setColor(Color.blue);\r
g.fillRect( (i-start) * width, y1, width, height);\r
\r
g.setColor(Color.white);\r
charOffset + x1 + width * (i-start),\r
y1 + height - pady);\r
\r
+ }catch(Exception ex){System.out.println(i+" "+fstart+" "+fend+" " +sf.getDescription()+" "+seq.getName()+" "+seq.getLength()); }\r
}\r
}\r
}\r