JAL-2388 Additional unit tests
[jalview.git] / src / jalview / viewmodel / OverviewDimensions.java
index 34b7aff..1f18a10 100644 (file)
@@ -193,7 +193,7 @@ public class OverviewDimensions
     int yAsSeq = Math.round((float) y * alheight / sequencesHeight);
 
     // get viewport height in sequences
-    int vpheight = props.getEndSeq() - props.getStartSeq();
+    int vpheight = props.getEndSeq() - props.getStartSeq() + 1;
 
     // get where y should be when accounting for hidden rows
     // if y is in a hidden row region, shift up - but we still need absolute
@@ -211,7 +211,7 @@ public class OverviewDimensions
       // went past the end of the alignment, adjust backwards
       endSeq = alheight;
       // recalc yAsSeq backwards from endSeq
-      yAsSeq = endSeq - vpheight;
+      yAsSeq = endSeq - vpheight + 1;
     }
 
     // convert absolute positions back to visible alignment positions for
@@ -253,7 +253,8 @@ public class OverviewDimensions
     boxWidth = Math
             .round((float) (endRes - startRes + 1) * width / alwidth);
     // boxHeight is the height in sequences translated to pixels
-    boxHeight = Math.round((float) (endSeq - startSeq) * sequencesHeight
+    boxHeight = Math.round((float) (endSeq - startSeq + 1)
+            * sequencesHeight
             / alheight);
   }