From: gmungoc Date: Thu, 19 Oct 2017 15:45:56 +0000 (+0100) Subject: JAL-2609 adjustments for test findings X-Git-Tag: Release_2_10_3b1~91^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d6ab1d005a0adbdf4997842893796cbef56b0f53;p=jalview.git JAL-2609 adjustments for test findings --- diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index adc36f9..6c6e87a 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -697,7 +697,6 @@ public class SeqCanvas extends JComponent implements ViewportListenerI * ensuring a part height includes at least one sequence */ ViewportRanges ranges = av.getRanges(); - int xMax = ranges.getVisibleAlignmentWidth(); wrappedVisibleWidths = canvasHeight / wrappedRepeatHeightPx; int remainder = canvasHeight % wrappedRepeatHeightPx; if (remainder >= (wrappedSpaceAboveAlignment + charHeight)) @@ -713,8 +712,10 @@ public class SeqCanvas extends JComponent implements ViewportListenerI /* * limit visibleWidths to not exceed width of alignment */ - int maxWidths = (xMax - ranges.getStartRes()) / wrappedWidthInResidues; - if (xMax % wrappedWidthInResidues > 0) + int xMax = ranges.getVisibleAlignmentWidth(); + int startToEnd = xMax - ranges.getStartRes(); + int maxWidths = startToEnd / wrappedWidthInResidues; + if (startToEnd % wrappedWidthInResidues > 0) { maxWidths++; } @@ -863,6 +864,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI } /** + * Draws markers (triangles) above hidden column positions between startColumn + * and endColumn. + * * @param g * @param ypos * @param startColumn @@ -881,7 +885,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI { int res = pos - startColumn; - if (res < 0 || res > endColumn - startColumn) + if (res < 0 || res > endColumn - startColumn + 1) { continue; } @@ -1662,7 +1666,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI // larger than the visible window ViewportRanges vpRanges = av.getRanges(); scrollX = (int) evt.getNewValue() - (int) evt.getOldValue(); - int range = vpRanges.getEndRes() - vpRanges.getStartRes(); + int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1; if (scrollX > range) { scrollX = range;