From: gmungoc Date: Tue, 5 Mar 2019 11:20:44 +0000 (+0000) Subject: Merge remote-tracking branch 'origin/bug/JAL-3002fastPaintWrapped' into develop X-Git-Tag: Release_2_11_0~17^2~70 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a3ca1aac6c00fc2240fa21be9df43adcc1b964ff;hp=cc52d6f3b8199cb3e9eab962feeab735c5bdc310;p=jalview.git Merge remote-tracking branch 'origin/bug/JAL-3002fastPaintWrapped' into develop --- diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 2a370c4..b3fcc54 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -1655,7 +1655,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI } ViewportRanges vpRanges = av.getRanges(); - int range = vpRanges.getEndRes() - vpRanges.getStartRes(); + int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1; if (scrollX > range) { scrollX = range; @@ -1724,10 +1724,10 @@ public class SeqCanvas extends JComponent implements ViewportListenerI { ViewportRanges ranges = av.getRanges(); - if (Math.abs(scrollX) > ranges.getViewportWidth()) + if (Math.abs(scrollX) >= ranges.getViewportWidth()) { /* - * shift of more than one view width is + * shift of one view width or more is * overcomplicated to handle in this method */ fastPaint = false; @@ -1918,10 +1918,17 @@ public class SeqCanvas extends JComponent implements ViewportListenerI while (y >= 0) { + /* + * shift 'widthToCopy' residues by 'positions' places to the right + */ gg.copyArea(copyFromLeftStart, y, widthToCopy, heightToCopy, positions * charWidth, 0); if (y > 0) { + /* + * copy 'positions' residue from the row above (right hand end) + * to this row's left hand end + */ gg.copyArea(copyFromRightStart, y - wrappedRepeatHeightPx, positions * charWidth, heightToCopy, -widthToCopy, wrappedRepeatHeightPx);