Dont draw origin beyond end of alignment
authoramwaterhouse <Andrew Waterhouse>
Mon, 30 Jan 2006 17:14:22 +0000 (17:14 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 30 Jan 2006 17:14:22 +0000 (17:14 +0000)
src/jalview/gui/AnnotationPanel.java

index 3a4a197..e3d8de1 100755 (executable)
@@ -622,7 +622,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
      */\r
     public void fastPaint(int horizontal)\r
     {\r
-        if ((horizontal == 0) ||\r
+        if ((horizontal == 0) || gg==null ||\r
                 (av.alignment.getAlignmentAnnotation() == null) ||\r
                 (av.alignment.getAlignmentAnnotation().length < 1))\r
         {\r
@@ -1039,7 +1039,8 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         y2 = (int)(y - (0-min / (range))*aa.graphHeight);\r
 \r
       g.setColor(Color.gray);\r
-      g.drawLine(x,y2,eRes*av.charWidth,y2);\r
+\r
+      g.drawLine(x,y2,(eRes-sRes+1)*av.charWidth,y2);\r
 \r
       eRes = Math.min(eRes, aa.annotations.length-1);\r
 \r