git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c8d5e3
)
checks for negative start column in restrict
author
jprocter
<Jim Procter>
Wed, 2 May 2007 12:19:55 +0000
(12:19 +0000)
committer
jprocter
<Jim Procter>
Wed, 2 May 2007 12:19:55 +0000
(12:19 +0000)
src/jalview/datamodel/AlignmentAnnotation.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/AlignmentAnnotation.java
b/src/jalview/datamodel/AlignmentAnnotation.java
index
cc4308d
..
3ed84a3
100755
(executable)
--- a/
src/jalview/datamodel/AlignmentAnnotation.java
+++ b/
src/jalview/datamodel/AlignmentAnnotation.java
@@
-357,12
+357,18
@@
Loading...
*/
public void restrict(int startRes, int endRes)
{
*/
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<annotations.length)
{
if (annotations==null)
return;
Annotation[] temp = new Annotation[endRes-startRes+1];
if (startRes<annotations.length)
{
- System.arraycopy(annotations, startRes, temp, 0, Math.min(endRes, annotations.length-1)-startRes+1);
+ System.arraycopy(annotations, startRes, temp, 0, endRes-startRes+1);
}
if (sequenceRef!=null) {
// Clip the mapping, if it exists.
}
if (sequenceRef!=null) {
// Clip the mapping, if it exists.