X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FScalePanel.java;h=aedb15790680f89c891aa79e49da177313936e54;hb=2303177fbc4c86e4a63c1e8efa8c8bc50516b6a5;hp=e595e6554eb05ff6f17e9e7ff44ba5a59cd2b96f;hpb=e224b72118c12cd77ae96f0f8d86c123e0416dc7;p=jalview.git diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e595e65..aedb157 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -494,7 +494,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener, int scalestartx = (startx / 10) * 10; SequenceI refSeq = av.getAlignment().getSeqrep(); - int refSp = 0, refEp = -1; + int refSp = 0, refEp = -1, refStart = 0, refEnd = -1, refStartI = 0, refEndI = -1; if (refSeq != null) { // find bounds and set origin appopriately @@ -502,8 +502,12 @@ public class ScalePanel extends JPanel implements MouseMotionListener, int[] refbounds = av.getColumnSelection() .locateVisibleBoundsOfSequence(refSeq); - refSp = refbounds[0] - 1; - refEp = refbounds[1] - 1; + refSp = refbounds[0]; + refEp = refbounds[1]; + refStart = refbounds[2]; + refEnd = refbounds[3]; + refStartI = refbounds[4]; + refEndI = refbounds[5]; scalestartx = refSp + ((scalestartx - refSp) / 10) * 10; } @@ -536,13 +540,13 @@ public class ScalePanel extends JPanel implements MouseMotionListener, // TODO show bounds if position is a gap // - ie L--R -> "1L|2R" for // marker - if (iadj < refSp) + if (iadj < refStartI) { - string = String.valueOf(iadj - refSp); + string = String.valueOf(iadj - refStartI); } - else if (iadj > refEp) + else if (iadj > refEndI) { - string = "+" + String.valueOf(iadj - refEp); + string = "+" + String.valueOf(iadj - refEndI); } else {