From d4ecfd4b33af067988249ea5e345f5b48e13f1de Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 3 Jul 2017 15:26:33 +0100 Subject: [PATCH] JAL-147 don't scroll Overview box outside panel dimensions --- src/jalview/viewmodel/OverviewDimensions.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jalview/viewmodel/OverviewDimensions.java b/src/jalview/viewmodel/OverviewDimensions.java index d2912d8..7ac07ac 100644 --- a/src/jalview/viewmodel/OverviewDimensions.java +++ b/src/jalview/viewmodel/OverviewDimensions.java @@ -231,7 +231,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 -- 1.7.10.2