From 6ef8b014737c1dac4f2e566e27cf4b34b68af9c0 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 8 Jun 2010 14:27:25 +0000 Subject: [PATCH] trim hidden regions outside selection when copying selected region to clipboard * JAL-573 --- src/jalview/gui/AlignFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 22647a3..0e607c7 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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 }); + } } } -- 1.7.10.2