From 4cf5450c35d616b2904246eeb866958dc14bd2d9 Mon Sep 17 00:00:00 2001 From: kiramt Date: Thu, 16 Mar 2017 12:12:31 +0000 Subject: [PATCH] JAL-2439 Out-by-one in setting endRes/endSeq --- src/jalview/viewmodel/ViewportPositionProps.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) { -- 1.7.10.2