X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqPanel.java;h=640b7e4b53c6dda68c4623ac366377df35a11227;hb=b482f8156c38c7b5ea498eec33f312375441c352;hp=f3502a6993fe6e789a714ee2f6055cee6649bae6;hpb=6ef8b014737c1dac4f2e566e27cf4b34b68af9c0;p=jalview.git diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index f3502a6..640b7e4 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1883,7 +1883,8 @@ public class SeqPanel extends JPanel implements MouseListener, } // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) - boolean repaint = false; + // rules are: colsel is copied if there is a real intersection between sequence selection + boolean repaint = false,copycolsel=true; if (av.selectionGroup == null || !av.isSelectionGroupChanged()) { SequenceGroup sgroup = null; @@ -1898,6 +1899,11 @@ public class SeqPanel extends JPanel implements MouseListener, } sgroup = seqsel.intersect(av.alignment, (av.hasHiddenRows) ? av.hiddenRepSequences : null); + if ((sgroup==null || sgroup.getSize()==0) && (colsel==null || colsel.size()==0)) + { + // don't copy columns if the region didn't intersect. + copycolsel=false; + } } if (sgroup != null && sgroup.getSize() > 0) { @@ -1909,7 +1915,7 @@ public class SeqPanel extends JPanel implements MouseListener, } repaint = av.isSelectionGroupChanged(); } - if (av.colSel == null || !av.isColSelChanged()) + if (copycolsel && (av.colSel == null || !av.isColSelChanged())) { // the current selection is unset or from a previous message // so import the new colsel. @@ -1922,6 +1928,7 @@ public class SeqPanel extends JPanel implements MouseListener, } else { + // TODO: shift colSel according to the intersecting sequences if (av.colSel == null) { av.colSel = new ColumnSelection(colsel); @@ -1933,7 +1940,7 @@ public class SeqPanel extends JPanel implements MouseListener, } repaint |= av.isColSelChanged(); } - if (av.hasHiddenColumns + if (copycolsel && av.hasHiddenColumns && (av.colSel == null || av.colSel.getHiddenColumns() == null)) { System.err.println("Bad things");