X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqCanvas.java;h=024fdc7f8b9fb07a7b60409d6dc8b447326bb4dd;hb=479c44e27a46c7cbee33e293dbc38cbca4fd2e0b;hp=bf54c667b4177c3f7341bb26de413e671b1e705f;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index bf54c66..024fdc7 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.SearchResults; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.viewmodel.AlignmentViewport; import java.awt.Color; import java.awt.FontMetrics; @@ -72,7 +73,7 @@ public class SeqCanvas extends Panel avcharWidth = av.getCharWidth(); } - public AlignViewport getViewport() + public AlignmentViewport getViewport() { return av; } @@ -275,6 +276,7 @@ public class SeqCanvas extends Panel * at 0). NOTE 1: The av limits are set in setFont in this class and in the * adjustment listener in SeqPanel when the scrollbars move. */ + @Override public void update(Graphics g) { paint(g); @@ -472,11 +474,10 @@ public class SeqCanvas extends Panel continue; } - gg.fillPolygon(new int[] - { res * avcharWidth - avcharHeight / 4, + gg.fillPolygon(new int[] { res * avcharWidth - avcharHeight / 4, res * avcharWidth + avcharHeight / 4, res * avcharWidth }, - new int[] - { ypos - (avcharHeight / 2), ypos - (avcharHeight / 2), + new int[] { ypos - (avcharHeight / 2), + ypos - (avcharHeight / 2), ypos - (avcharHeight / 2) + 8 }, 3); } @@ -528,11 +529,9 @@ public class SeqCanvas extends Panel } private void drawPanel(Graphics g1, int startRes, int endRes, - int startSeq, - int endSeq, int offset) + int startSeq, int endSeq, int offset) { - if (!av.hasHiddenColumns()) { draw(g1, startRes, endRes, startSeq, endSeq, offset); @@ -575,10 +574,17 @@ public class SeqCanvas extends Panel g1.translate(-screenY * avcharWidth, 0); screenY += blockEnd - blockStart + 1; blockStart = hideEnd + 1; + + if (screenY > (endRes - startRes)) + { + // already rendered last block + return; + } } } if (screenY <= (endRes - startRes)) { + // remaining visible region to render blockEnd = blockStart + (endRes - startRes) - screenY; g1.translate(screenY * avcharWidth, 0); draw(g1, blockStart, blockEnd, startSeq, endSeq, offset); @@ -826,8 +832,7 @@ public class SeqCanvas extends Panel break; } - group = av.getAlignment().getGroups() - .get(groupIndex); + group = av.getAlignment().getGroups().get(groupIndex); } while (groupIndex < av.getAlignment().getGroups().size()); }