git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch for incorrect column selection when hidden regions are present * JAL-558
[jalview.git]
/
src
/
jalview
/
gui
/
ScalePanel.java
diff --git
a/src/jalview/gui/ScalePanel.java
b/src/jalview/gui/ScalePanel.java
index
2acd92c
..
907fe69
100755
(executable)
--- a/
src/jalview/gui/ScalePanel.java
+++ b/
src/jalview/gui/ScalePanel.java
@@
-72,10
+72,13
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
if (av.hasHiddenColumns)
{
if (av.hasHiddenColumns)
{
- res = av.getColumnSelection().adjustForHiddenColumns(x);
+ x = av.getColumnSelection().adjustForHiddenColumns(x);
}
}
- else
+
+ if (x >= av.alignment.getWidth())
{
{
+ res = av.alignment.getWidth() - 1;
+ } else {
res = x;
}
res = x;
}
@@
-169,7
+172,6
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
iVec = null;
sg.setStartRes(res);
sg.setEndRes(res);
iVec = null;
sg.setStartRes(res);
sg.setEndRes(res);
- av.setSelectionGroup(sg);
if (evt.isShiftDown())
{
if (evt.isShiftDown())
{
@@
-182,7
+184,7
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
sg.setStartRes(min);
sg.setEndRes(max);
}
sg.setStartRes(min);
sg.setEndRes(max);
}
-
+ av.setSelectionGroup(sg);
}
ap.paintAlignment(false);
}
ap.paintAlignment(false);
@@
-201,14
+203,14
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
- if (res > av.alignment.getWidth())
+ if (av.hasHiddenColumns)
{
{
- res = av.alignment.getWidth() - 1;
+ res = av.getColumnSelection().adjustForHiddenColumns(res);
}
}
- if (av.hasHiddenColumns)
+ if (res >= av.alignment.getWidth())
{
{
- res = av.getColumnSelection().adjustForHiddenColumns(res);
+ res = av.alignment.getWidth() - 1;
}
if (!stretchingGroup)
}
if (!stretchingGroup)
@@
-257,7
+259,7
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (res > av.alignment.getWidth())
+ if (res >= av.alignment.getWidth())
{
res = av.alignment.getWidth() - 1;
}
{
res = av.alignment.getWidth() - 1;
}
@@
-295,7
+297,7
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
int col;
for (int i = min; i <= max; i++)
{
int col;
for (int i = min; i <= max; i++)
{
- col = av.getColumnSelection().adjustForHiddenColumns(i);
+ col = i; // av.getColumnSelection().adjustForHiddenColumns(i);
if ((col < sg.getStartRes()) || (col > sg.getEndRes()))
{
if ((col < sg.getStartRes()) || (col > sg.getEndRes()))
{
@@
-398,6
+400,7
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
// Fill the selected columns
ColumnSelection cs = av.getColumnSelection();
// Fill the selected columns
ColumnSelection cs = av.getColumnSelection();
+ int s;
if (cs != null)
{
gg.setColor(new Color(220, 0, 0));
if (cs != null)
{
gg.setColor(new Color(220, 0, 0));
@@
-407,7
+410,14
@@
public class ScalePanel extends JPanel implements MouseMotionListener,
int sel = cs.columnAt(i);
if (av.hasHiddenColumns)
{
int sel = cs.columnAt(i);
if (av.hasHiddenColumns)
{
- sel = cs.findColumnPosition(sel);
+ if (cs.isVisible(sel))
+ {
+ sel = cs.findColumnPosition(sel);
+ }
+ else
+ {
+ continue;
+ }
}
if ((sel >= startx) && (sel <= endx))
}
if ((sel >= startx) && (sel <= endx))