From a3b3c4269d29f085e573cbeb731f3fb5dfb7b0c9 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 2 May 2007 12:19:55 +0000 Subject: [PATCH] checks for negative start column in restrict --- src/jalview/datamodel/AlignmentAnnotation.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index cc4308d..3ed84a3 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -357,12 +357,18 @@ Loading... */ public void restrict(int startRes, int endRes) { + if (startRes<0) + startRes=0; + if (startRes>=annotations.length) + startRes = annotations.length-1; + if (endRes>=annotations.length) + endRes = annotations.length-1; if (annotations==null) return; Annotation[] temp = new Annotation[endRes-startRes+1]; if (startRes