From d7e33557512a6e6c3c604aeb6ff67c023ee5c251 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 4 May 2007 10:31:18 +0000 Subject: [PATCH] Annotations do not extend when full alignment is adjusted --- src/jalview/commands/EditCommand.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index aece057..61e2595 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -112,7 +112,7 @@ public class EditCommand /** * append a new editCommand * Note. this shouldn't be called if the edit is an operation affects more alignment objects than the one referenced - * in al (for example, cut or pasting whole sequences). Use the form with an additional AlignmentI[] views parameter. + * in al (for example, cut or pasting whole sequences). Use the form with an additional AlignmentI[] views parameter. * @param command * @param seqs * @param position @@ -232,6 +232,7 @@ public class EditCommand final void insertGap(Edit command) { + for (int s = 0; s < command.seqs.length; s++) { command.seqs[s].insertCharAt(command.position, @@ -403,7 +404,6 @@ public class EditCommand final void adjustAnnotations(Edit command, boolean insert, boolean modifyVisibility, AlignmentI[] views) { - AlignmentAnnotation[] annotations = null; if (modifyVisibility && !insert) @@ -440,7 +440,7 @@ public class EditCommand } command.seqs[s].setAlignmentAnnotation(null); if (alen!=tmp.length) - { + { // save the non-null annotation references only AlignmentAnnotation[] saved = new AlignmentAnnotation[alen]; for (int aa=0,aapos=0;aa aSize) + if (command.position + command.number >= aSize) { tSize = aSize; } else { - tSize = aSize - command.number + command.position; + tSize = aSize - command.number; } } else @@ -603,9 +599,9 @@ public class EditCommand tSize = aSize; } temp = new Annotation[tSize]; - } + if (insert) { if (command.position < annotations[a].annotations.length) -- 1.7.10.2