Merge branch 'develop' into feature/JAL-2611
[jalview.git] / src / jalview / viewmodel / OverviewDimensions.java
index ee3b511..f54c1eb 100644 (file)
@@ -272,7 +272,8 @@ public abstract class OverviewDimensions
     resetAlignmentDims();
 
     // boxX, boxY is the x,y location equivalent to startRes, startSeq
-    boxX = Math.round((float) startRes * width / alwidth);
+    int xPos = Math.min(startRes, alwidth - vpwidth + 1);
+    boxX = Math.round((float) xPos * width / alwidth);
     boxY = Math.round((float) startSeq * sequencesHeight / alheight);
 
     // boxWidth is the width in residues translated to pixels