git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5edb685
)
JAL-2388 Working overview panel
author
kiramt
<k.mourao@dundee.ac.uk>
Tue, 14 Mar 2017 16:42:01 +0000
(16:42 +0000)
committer
kiramt
<k.mourao@dundee.ac.uk>
Tue, 14 Mar 2017 16:42:01 +0000
(16:42 +0000)
src/jalview/viewmodel/OverviewDimensions.java
patch
|
blob
|
history
diff --git
a/src/jalview/viewmodel/OverviewDimensions.java
b/src/jalview/viewmodel/OverviewDimensions.java
index
4af4175
..
60b4ee9
100644
(file)
--- a/
src/jalview/viewmodel/OverviewDimensions.java
+++ b/
src/jalview/viewmodel/OverviewDimensions.java
@@
-162,22
+162,23
@@
public class OverviewDimensions
// if x is in a hidden col region, shift to left - but we still need
// absolute position
// so convert back after getting visible region position
// if x is in a hidden col region, shift to left - but we still need
// absolute position
// so convert back after getting visible region position
- xAsRes = hiddenCols.adjustForHiddenColumns(hiddenCols
- .findColumnPosition(xAsRes));
-
- // get where end res should be by adding the viewport width on
- // subtract 1 because the width includes endRes
- int endRes = xAsRes + vpwidth - 1;
+ int visXAsRes = hiddenCols.findColumnPosition(xAsRes);
// check in case we went off the edge of the alignment
// check in case we went off the edge of the alignment
- int visAlignWidth = hiddenCols.findColumnPosition(alwidth);
- if (endRes > visAlignWidth - 1)
+ int visAlignWidth = hiddenCols.findColumnPosition(alwidth - 1);
+ if (visXAsRes + vpwidth - 1 > visAlignWidth)
{
// went past the end of the alignment, adjust backwards
{
// went past the end of the alignment, adjust backwards
- endRes = visAlignWidth - 1;
- // recalc xAsRes backwards from endRes
- // add 1 because width includes xAsRes
- xAsRes = hiddenCols.adjustForHiddenColumns(endRes - vpwidth + 1);
+
+ // if last position was before the end of the alignment, need to update
+ if ((scrollCol + vpwidth - 1) < visAlignWidth)
+ {
+ visXAsRes = hiddenCols.findColumnNToLeft(vpwidth - 1, alwidth - 1);
+ }
+ else
+ {
+ visXAsRes = scrollCol;
+ }
}
//
}
//
@@
-203,18
+204,26
@@
public class OverviewDimensions
// check in case we went off the edge of the alignment
int visAlignHeight = hiddenSeqs.findIndexWithoutHiddenSeqs(alheight);
// check in case we went off the edge of the alignment
int visAlignHeight = hiddenSeqs.findIndexWithoutHiddenSeqs(alheight);
- if (hiddenSeqs.findIndexWithoutHiddenSeqs(endSeq) > visAlignHeight - 1)
+ int visYAsRes = hiddenSeqs.findIndexWithoutHiddenSeqs(yAsSeq);
+ if (hiddenSeqs.findIndexWithoutHiddenSeqs(endSeq) > visAlignHeight)
{
// went past the end of the alignment, adjust backwards
{
// went past the end of the alignment, adjust backwards
- endSeq = visAlignHeight - 1;
- // recalc yAsSeq backwards from endSeq
- yAsSeq = endSeq - vpheight + 1;
+ if ((scrollRow + vpheight - 1) < visAlignHeight)
+ {
+ visYAsRes = hiddenSeqs
+ .findIndexNAboveRow(vpheight - 1, alheight - 1);
+ }
+ else
+ {
+ visYAsRes = scrollRow;
+ }
}
// convert absolute positions back to visible alignment positions for
// viewport scrolling
}
// convert absolute positions back to visible alignment positions for
// viewport scrolling
- scrollCol = hiddenCols.findColumnPosition(xAsRes);
- scrollRow = hiddenSeqs.findIndexWithoutHiddenSeqs(yAsSeq);
+ scrollCol = visXAsRes;
+ scrollRow = visYAsRes; // hiddenSeqs.findIndexWithoutHiddenSeqs(yAsSeq);
+
}
/**
}
/**
@@
-252,8
+261,6
@@
public class OverviewDimensions
boxWidth = Math
.round((float) (endRes - startRes + 1) * width / alwidth);
// boxHeight is the height in sequences translated to pixels
boxWidth = Math
.round((float) (endRes - startRes + 1) * width / alwidth);
// boxHeight is the height in sequences translated to pixels
- // since the box includes both the start and end sequences, add 1 to the
- // difference
boxHeight = Math.round((float) (endSeq - startSeq + 1)
* sequencesHeight
/ alheight);
boxHeight = Math.round((float) (endSeq - startSeq + 1)
* sequencesHeight
/ alheight);