X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=b4ef770883b7d6947dd810d688dd4d1666219b12;hb=c20e9d4ae9c98b093e74a10bf965e6d20d80fadf;hp=8623872ff550697490b6fcfc3e791e57ce448e5f;hpb=628a29c56cc280f434f3568f3bf79555e1c77726;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 8623872..b4ef770 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -600,10 +600,11 @@ public class SeqCanvas extends JComponent if(av.getShowHiddenMarkers()) { g1.setColor(Color.blue); + g1.drawLine( (blockEnd - blockStart + 1) * av.charWidth - 1, - startSeq + offset, + 0+offset, (blockEnd - blockStart + 1) * av.charWidth - 1, - startSeq + (endSeq - startSeq) * av.charHeight + offset); + (endSeq - startSeq) * av.charHeight + offset); } g1.translate( -screenY * av.charWidth, 0); @@ -698,6 +699,7 @@ public class SeqCanvas extends JComponent int sy = -1; int ex = -1; int groupIndex = -1; + int visWidth = (endRes - startRes +1) * av.charWidth; if ((group == null) && (av.alignment.getGroups().size() > 0)) { @@ -705,6 +707,7 @@ public class SeqCanvas extends JComponent groupIndex = 0; } + if (group != null) { do @@ -722,7 +725,7 @@ public class SeqCanvas extends JComponent ex = (((group.getEndRes() + 1) - group.getStartRes()) * av.charWidth) - 1; - if(sx+ex<0 || sx>imgWidth) + if(sx+ex<0 || sx>visWidth) { continue; } @@ -769,10 +772,10 @@ public class SeqCanvas extends JComponent { if (inGroup) { - if (sx >= 0 && sx < imgWidth) + if (sx >= 0 && sx < visWidth) g.drawLine(sx, oldY, sx, sy); - if (sx + ex < imgWidth) + if (sx + ex < visWidth) g.drawLine(sx + ex, oldY, sx + ex, sy); if (sx < 0) @@ -781,8 +784,8 @@ public class SeqCanvas extends JComponent sx = 0; } - if (sx + ex > imgWidth) - ex = imgWidth; + if (sx + ex > visWidth) + ex = visWidth; else if (sx + ex >= (endRes - startRes + 1) * av.charWidth) ex = (endRes - startRes + 1) * av.charWidth; @@ -807,10 +810,10 @@ public class SeqCanvas extends JComponent if (inGroup) { sy = offset + ( (i - startSeq) * av.charHeight); - if (sx >= 0 && sx < imgWidth) + if (sx >= 0 && sx < visWidth) g.drawLine(sx, oldY, sx, sy); - if (sx + ex < imgWidth) + if (sx + ex < visWidth) g.drawLine(sx + ex, oldY, sx + ex, sy); if (sx < 0) @@ -819,8 +822,8 @@ public class SeqCanvas extends JComponent sx = 0; } - if (sx + ex > imgWidth) - ex = imgWidth; + if (sx + ex > visWidth) + ex = visWidth; else if (sx + ex >= (endRes - startRes + 1) * av.charWidth) ex = (endRes - startRes + 1) * av.charWidth; @@ -841,6 +844,8 @@ public class SeqCanvas extends JComponent groupIndex++; + g.setStroke(new BasicStroke()); + if (groupIndex >= av.alignment.getGroups().size()) { break; @@ -848,7 +853,7 @@ public class SeqCanvas extends JComponent group = (SequenceGroup) av.alignment.getGroups().elementAt(groupIndex); - g.setStroke(new BasicStroke()); + } while (groupIndex < av.alignment.getGroups().size());