bug adding null sequence to selection fixed
authoramwaterhouse <Andrew Waterhouse>
Fri, 8 Apr 2005 15:01:52 +0000 (15:01 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 8 Apr 2005 15:01:52 +0000 (15:01 +0000)
src/jalview/gui/SeqPanel.java

index 3595fe6..3bfc7db 100755 (executable)
@@ -175,8 +175,6 @@ public class SeqPanel extends JPanel
       y %= chunkHeight;\r
       seq =     y / av.getCharHeight() + av.getStartSeq();\r
 \r
-      //   chunkHeight =  (da.getHeight() + 2)*charHeight;\r
-      //  startx += chunkWidth;\r
     }\r
     else\r
     {\r
@@ -513,6 +511,10 @@ public class SeqPanel extends JPanel
     if(stretchGroup==null)\r
       return;\r
 \r
+    if(res>av.alignment.getWidth()-2)\r
+      res = av.alignment.getWidth()-2;\r
+\r
+\r
     if(stretchGroup.getEndRes()==res)\r
       // Edit end res position of selected group\r
       changeEndRes = true;\r
@@ -560,6 +562,7 @@ public class SeqPanel extends JPanel
       }\r
       else\r
       {\r
+       if(seq!=null)\r
         stretchGroup.addSequence(seq);\r
         stretchGroup.addSequence(nextSeq);\r
       }\r