X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=6c50f31c69535d35b5afd94f84564253b9c16794;hb=e7ed63f1ea56432246a6ed1553f0fe56d26f56ea;hp=959c83c28264a1a1bc73219b2d3958a0e4483cf2;hpb=c3162a6dd5f226c743bce629cf125a17c9b67711;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 959c83c..6c50f31 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -56,16 +56,23 @@ public class IdCanvas extends JPanel gg.copyArea( 0,0, getWidth(), imgHeight, 0, -vertical*av.charHeight ); int ss=av.startSeq, es=av.endSeq, transY = 0; - if(vertical>0) // scroll down + if (vertical > 0) // scroll down { - transY = imgHeight - vertical*av.charHeight; ss = es - vertical; + if(ss av.endSeq) + es = av.endSeq; } + + gg.translate(0, transY); drawIds(ss, es); @@ -84,8 +91,8 @@ public class IdCanvas extends JPanel if (fastPaint) { - g.drawImage(image, 0, 0, this); fastPaint = false; + g.drawImage(image, 0, 0, this); return; } @@ -109,18 +116,18 @@ public class IdCanvas extends JPanel void drawIds(int starty, int endy) { - Color currentColor = Color.white; Color currentTextColor = Color.black; if (av.getWrapAlignment()) { + + int rowSize = av.getEndRes() - av.getStartRes(); // Draw the rest of the panels - int chunkHeight = (av.alignment.getHeight() + 2)*av.charHeight; - int row = av.getStartRes() / av.chunkWidth ; - for(int ypos=2*av.charHeight; - ypos <= getHeight() && row*av.chunkWidth