trim hidden regions outside selection when copying selected region to clipboard ...
authorjprocter <Jim Procter>
Tue, 8 Jun 2010 14:27:25 +0000 (14:27 +0000)
committerjprocter <Jim Procter>
Tue, 8 Jun 2010 14:27:25 +0000 (14:27 +0000)
src/jalview/gui/AlignFrame.java

index 22647a3..0e607c7 100755 (executable)
@@ -1530,15 +1530,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (viewport.hasHiddenColumns)
     {
       hiddenColumns = new Vector();
-      int hiddenOffset = viewport.getSelectionGroup().getStartRes();
+      int hiddenOffset = viewport.getSelectionGroup().getStartRes(),hiddenCutoff=viewport.getSelectionGroup().getEndRes();
       for (int i = 0; i < viewport.getColumnSelection().getHiddenColumns()
               .size(); i++)
       {
         int[] region = (int[]) viewport.getColumnSelection()
                 .getHiddenColumns().elementAt(i);
-
-        hiddenColumns.addElement(new int[]
+        if (region[0]>=hiddenOffset && region[1]<=hiddenCutoff)
+        {
+          hiddenColumns.addElement(new int[]
         { region[0] - hiddenOffset, region[1] - hiddenOffset });
+        }
       }
     }