From: kiramt Date: Thu, 16 Mar 2017 12:12:31 +0000 (+0000) Subject: JAL-2439 Out-by-one in setting endRes/endSeq X-Git-Tag: Release_2_10_2~3^2~92^2~37 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4cf5450c35d616b2904246eeb866958dc14bd2d9;p=jalview.git JAL-2439 Out-by-one in setting endRes/endSeq --- diff --git a/src/jalview/viewmodel/ViewportPositionProps.java b/src/jalview/viewmodel/ViewportPositionProps.java index d143130..61dd18c 100644 --- a/src/jalview/viewmodel/ViewportPositionProps.java +++ b/src/jalview/viewmodel/ViewportPositionProps.java @@ -108,9 +108,9 @@ public class ViewportPositionProps extends ViewportProperties */ public void setEndRes(int res) { - if (res > al.getWidth()) + if (res >= al.getWidth()) { - res = al.getWidth(); + res = al.getWidth() - 1; } else if (res < 1) { @@ -146,9 +146,9 @@ public class ViewportPositionProps extends ViewportProperties */ public void setEndSeq(int seq) { - if (seq > al.getHeight()) + if (seq >= al.getHeight()) { - seq = al.getHeight(); + seq = al.getHeight() - 1; } else if (seq < 1) {