JAL-2808 update spike to latest (filter range tooltip, Present condition)
[jalview.git] / src / jalview / viewmodel / OverviewDimensions.java
index ee3b511..170f4e9 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
@@ -300,7 +301,8 @@ public abstract class OverviewDimensions
   /*
    * Given the centre x position, calculate the box's left x position
    */
-  protected abstract int getLeftXFromCentreX(int mousex, HiddenColumns hidden);
+  protected abstract int getLeftXFromCentreX(int mousex,
+          HiddenColumns hidden);
 
   /*
    * Given the centre y position, calculate the box's top y position