From: jprocter Date: Tue, 8 Jun 2010 14:25:36 +0000 (+0000) Subject: Patch for incorrect column selection when hidden regions are present * JAL-558 X-Git-Tag: Release_2_5_1~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3deb483e2e7f67fecbcb767d8752174ad410d441;p=jalview.git Patch for incorrect column selection when hidden regions are present * JAL-558 --- diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index 4371994..63a5700 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -508,8 +508,8 @@ public class ColumnSelection } /** - * Use this method to find out where a visible column is in the alignment when - * hidden columns exist + * Use this method to find out where a column will appear in the visible alignment when + * hidden columns exist. If the column is not visible, then the left-most visible column will always be returned. * * @param hiddenColumn * int @@ -521,21 +521,21 @@ public class ColumnSelection if (hiddenColumns != null) { int index = 0; - int gaps = 0; + int[] region; do { - int[] region = (int[]) hiddenColumns.elementAt(index); + region = (int[]) hiddenColumns.elementAt(index++); if (hiddenColumn > region[1]) { result -= region[1] + 1 - region[0]; } - index++; - } while (index < hiddenColumns.size()); - - result -= gaps; + } while ((hiddenColumn > region[1]) && (index < hiddenColumns.size())); + if (hiddenColumn>region[0] && hiddenColumn