From 0cb944b4ce24af1ba14204582bf2b045ad3f5cc8 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 13 Apr 2005 16:33:26 +0000 Subject: [PATCH] draws last residue --- src/jalview/gui/AnnotationPanel.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 26f6084..420e369 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -330,27 +330,25 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio return; } - imgWidth = (av.endRes-av.startRes) *av.charWidth; + imgWidth = (av.endRes-av.startRes+1) *av.charWidth; image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(), BufferedImage.TYPE_INT_RGB); gg = (Graphics2D) image.getGraphics(); - gg.setColor(Color.white); - gg.fillRect(0, 0, imgWidth, getHeight()); gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); fm = gg.getFontMetrics(); gg.setFont(av.getFont()); - - drawComponent( gg, av.startRes, av.endRes); + drawComponent( gg, av.startRes, av.endRes+1); g.drawImage( image, 0, 0, this); + } public void fastPaint(int horizontal) { - if( horizontal ==0 + if( horizontal == 0 || av.alignment.getAlignmentAnnotation()==null || av.alignment.getAlignmentAnnotation().length<1 ) @@ -360,7 +358,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio } gg.copyArea( 0,0, imgWidth, getHeight(), -horizontal*av.charWidth, 0 ); - int sr=av.startRes, er=av.endRes, transX=0; + int sr=av.startRes, er=av.endRes+1, transX=0; if(horizontal>0) // scrollbar pulled right, image to the left { @@ -405,6 +403,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio int iconOffset = av.charHeight/2; boolean validRes = false; //\u03B2 \u03B1 + for(int i=0; i