X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2FOverviewDimensions.java;h=4af4175df085927bda609eabe26ab8c9f406c613;hb=7e66b58086ec1368feaa6c32e6478d66734c152a;hp=4a2dd29c401a05a40d1f71a240e3bd2c9c1445c2;hpb=ed8a4149077b4debd9d51cca5141287e17b25fad;p=jalview.git diff --git a/src/jalview/viewmodel/OverviewDimensions.java b/src/jalview/viewmodel/OverviewDimensions.java index 4a2dd29..4af4175 100644 --- a/src/jalview/viewmodel/OverviewDimensions.java +++ b/src/jalview/viewmodel/OverviewDimensions.java @@ -138,19 +138,11 @@ public class OverviewDimensions { x = 0; } - else if (x >= width) - { - x = alwidth - 1; - } if (y < 0) { y = 0; } - else if (y >= sequencesHeight) - { - y = alheight - 1; - } // // Convert x value to residue position @@ -178,13 +170,14 @@ public class OverviewDimensions int endRes = xAsRes + vpwidth - 1; // check in case we went off the edge of the alignment - if (endRes > alwidth) + int visAlignWidth = hiddenCols.findColumnPosition(alwidth); + if (endRes > visAlignWidth - 1) { // went past the end of the alignment, adjust backwards - endRes = alwidth; + endRes = visAlignWidth - 1; // recalc xAsRes backwards from endRes // add 1 because width includes xAsRes - xAsRes = endRes - vpwidth + 1; + xAsRes = hiddenCols.adjustForHiddenColumns(endRes - vpwidth + 1); } // @@ -209,10 +202,11 @@ public class OverviewDimensions int endSeq = yAsSeq + vpheight - 1; // check in case we went off the edge of the alignment - if (endSeq > alheight) + int visAlignHeight = hiddenSeqs.findIndexWithoutHiddenSeqs(alheight); + if (hiddenSeqs.findIndexWithoutHiddenSeqs(endSeq) > visAlignHeight - 1) { // went past the end of the alignment, adjust backwards - endSeq = alheight; + endSeq = visAlignHeight - 1; // recalc yAsSeq backwards from endSeq yAsSeq = endSeq - vpheight + 1; }