X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FColumnSelection.java;h=9dbaced7e003f24275d064d64b6b274298649dfe;hb=eb5197242ba17fcff4ce0e18419ca81a63418f7a;hp=ca54570a09085a98f06ad0b90425e43b7b4ec8f9;hpb=aa25fa143274ada02f7dfe5209864ff1231b8e65;p=jalview.git diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index ca54570..9dbaced 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -998,15 +998,17 @@ public class ColumnSelection if (end > blockStart) { annels.addElement(els = new Annotation[end - blockStart + 1]); - if (end - blockStart + 1 <= alignmentAnnotation.annotations.length) + if ((els.length+blockStart)<= alignmentAnnotation.annotations.length) { + // copy just the visible segment of the annotation row System.arraycopy(alignmentAnnotation.annotations, blockStart, els, 0, els.length); } else { + // copy to the end of the annotation row System.arraycopy(alignmentAnnotation.annotations, blockStart, - els, 0, (end - blockStart + 1)); + els, 0, (alignmentAnnotation.annotations.length - blockStart)); } w += els.length; }