From: gmungoc Date: Mon, 3 Jul 2017 14:26:33 +0000 (+0100) Subject: JAL-147 don't scroll Overview box outside panel dimensions X-Git-Tag: Release_2_10_3b1~132^2~59 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d4ecfd4b33af067988249ea5e345f5b48e13f1de;p=jalview.git JAL-147 don't scroll Overview box outside panel dimensions --- 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