From 0ad8259c1d61d8397e1722238f2295e5d4089875 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 4 Jul 2017 09:12:13 +0100 Subject: [PATCH] JAL-147 extract local variable for ease of debugging --- src/jalview/viewmodel/ViewportRanges.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/jalview/viewmodel/ViewportRanges.java b/src/jalview/viewmodel/ViewportRanges.java index 36e598f..abbc24c 100644 --- a/src/jalview/viewmodel/ViewportRanges.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -227,9 +227,10 @@ public class ViewportRanges extends ViewportProperties public void setStartEndSeq(int start, int end) { int oldstartseq = this.startSeq; - if (start > getVisibleAlignmentHeight() - 1) + int visibleHeight = getVisibleAlignmentHeight(); + if (start > visibleHeight - 1) { - startSeq = Math.max(getVisibleAlignmentHeight() - 1, 0); + startSeq = Math.max(visibleHeight - 1, 0); } else if (start < 0) { @@ -241,9 +242,9 @@ public class ViewportRanges extends ViewportProperties } int oldendseq = this.endSeq; - if (end >= getVisibleAlignmentHeight()) + if (end >= visibleHeight) { - endSeq = Math.max(getVisibleAlignmentHeight() - 1, 0); + endSeq = Math.max(visibleHeight - 1, 0); } else if (end < 0) { -- 1.7.10.2