From b9c2f4b60cd997cc03ab560cbf211331b3658968 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 18 Apr 2006 13:17:20 +0000 Subject: [PATCH] -1 from east scale, wrapped alignment --- src/jalview/appletgui/SeqCanvas.java | 6 +++--- src/jalview/gui/SeqCanvas.java | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index f6ef577..c5b4324 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -141,7 +141,7 @@ public class SeqCanvas continue; } - value = av.alignment.getSequenceAt(i).findPosition(index); + value = seq.findPosition(index); break; } if (value != -1) @@ -366,7 +366,7 @@ public class SeqCanvas while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth())) { - endx = startRes + cWidth; + endx = startRes + cWidth -1; if (endx > al.getWidth()) { @@ -407,7 +407,7 @@ public class SeqCanvas if(annotations==null) annotations = new AnnotationPanel(av); - annotations.drawComponent( g, startRes, endx ); + annotations.drawComponent( g, startRes, endx+1 ); g.translate(0, -cHeight - ypos-4); } g.translate(-LABEL_WEST, 0); diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 99447a4..d9f7ebb 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -180,15 +180,14 @@ public class SeqCanvas extends JComponent if(av.hasHiddenColumns) endx = av.getColumnSelection().adjustForHiddenColumns(endx); + SequenceI seq; // EAST SCALE for (int i = 0; i < av.alignment.getHeight(); i++) { - SequenceI seq = av.alignment.getSequenceAt(i); + seq = av.alignment.getSequenceAt(i); int index = endx; int value = -1; - - while (index > startx) { if (jalview.util.Comparison.isGap(seq.getCharAt(index))) @@ -198,7 +197,7 @@ public class SeqCanvas extends JComponent continue; } - value = av.alignment.getSequenceAt(i).findPosition(index); + value = seq.findPosition(index); break; } @@ -441,7 +440,7 @@ public class SeqCanvas extends JComponent while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth())) { - endx = startRes + cWidth; + endx = startRes + cWidth -1; if (endx > al.getWidth()) { @@ -492,7 +491,7 @@ public class SeqCanvas extends JComponent if(annotations==null) annotations = new AnnotationPanel(av); - annotations.drawComponent( (Graphics2D) g, startRes, endx); + annotations.drawComponent( (Graphics2D) g, startRes, endx+1); g.translate(0, -cHeight - ypos); } g.setClip(clip); -- 1.7.10.2