X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqCanvas.java;h=0df43221d887ea52b81726be920d580b8dfe54b2;hb=2ac5b6423fe366e093c8f12b0935aefc9aafbe5f;hp=f6ef5779f0e3433e508c8d38b14370e3301c15e9;hpb=f7d45a21db810c5f8f7ca668d1a28f1403defe32;p=jalview.git diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index f6ef577..0df4322 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) @@ -294,6 +294,8 @@ public class SeqCanvas int LABEL_WEST, LABEL_EAST; public int getWrappedCanvasWidth(int cwidth) { + cwidth -= cwidth % av.charWidth; + FontMetrics fm = getFontMetrics(av.getFont()); LABEL_EAST = 0; @@ -334,15 +336,12 @@ public class SeqCanvas FontMetrics fm = getFontMetrics(av.getFont()); - int LABEL_EAST = 0; if (av.scaleRightWrapped) { LABEL_EAST = fm.stringWidth(getMask()); } - int LABEL_WEST = 0; - if (av.scaleLeftWrapped) { LABEL_WEST = fm.stringWidth(getMask()); @@ -366,7 +365,7 @@ public class SeqCanvas while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth())) { - endx = startRes + cWidth; + endx = startRes + cWidth -1; if (endx > al.getWidth()) { @@ -407,7 +406,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); @@ -496,7 +495,7 @@ public class SeqCanvas groupIndex = 0; } - if ( group != null) + if ( group != null ) { do { @@ -505,6 +504,7 @@ public class SeqCanvas boolean inGroup = false; int top = -1; int bottom = -1; + int alHeight = av.alignment.getHeight()-1; for (i = startSeq; i < endSeq; i++) { @@ -519,21 +519,21 @@ public class SeqCanvas } if ( (sx <= (endRes-startRes)*av.charWidth) && - group.sequences.contains(av.alignment.getSequenceAt( + group.getSequences(false).contains(av.alignment.getSequenceAt( i))) { - if (bottom == -1) + if ( (bottom == -1) && + (i >= alHeight || + !group.getSequences(false).contains( + av.alignment.getSequenceAt(i + 1)))) { - if(i == endSeq-1 || // Dont check for i+1 if on the bottom row - !group.sequences.contains(av.alignment.getSequenceAt(i+1 ))) - bottom = sy + av.charHeight; } if (!inGroup) { if (((top == -1) && (i == 0)) || - !group.sequences.contains( + !group.getSequences(false).contains( av.alignment.getSequenceAt(i - 1))) { top = sy;