From c2ec295699b0e198ae1981bd3807394060f5c6d6 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 24 Oct 2017 11:28:56 +0100 Subject: [PATCH] JAL-2788 corrected merge error in propertyChange --- src/jalview/gui/SeqCanvas.java | 70 +++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index d82f69a..2a9c704 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -1658,48 +1658,50 @@ public class SeqCanvas extends JComponent implements ViewportListenerI { fastPaint = true; repaint(); + return; } - else if (eventName.equals(ViewportRanges.STARTRES)) + + int scrollX = 0; + if (eventName.equals(ViewportRanges.STARTRES)) { - int scrollX = 0; - if (eventName.equals(ViewportRanges.STARTRES)) + // Make sure we're not trying to draw a panel + // larger than the visible window + ViewportRanges vpRanges = av.getRanges(); + scrollX = (int) evt.getNewValue() - (int) evt.getOldValue(); + int range = vpRanges.getViewportWidth(); + if (scrollX > range) { - // Make sure we're not trying to draw a panel - // larger than the visible window - ViewportRanges vpRanges = av.getRanges(); - scrollX = (int) evt.getNewValue() - (int) evt.getOldValue(); - int range = vpRanges.getViewportWidth(); - if (scrollX > range) - { - scrollX = range; - } - else if (scrollX < -range) - { - scrollX = -range; - } + scrollX = range; + } + else if (scrollX < -range) + { + scrollX = -range; + } + } - // Both scrolling and resizing change viewport ranges: scrolling changes - // both start and end points, but resize only changes end values. - // Here we only want to fastpaint on a scroll, with resize using a normal - // paint, so scroll events are identified as changes to the horizontal or - // vertical start value. - - // scroll - startres and endres both change - if (av.getWrapAlignment()) - { - fastPaintWrapped(scrollX); - } - else - { - fastPaint(scrollX, 0); - } + // Both scrolling and resizing change viewport ranges: scrolling changes + // both start and end points, but resize only changes end values. + // Here we only want to fastpaint on a scroll, with resize using a normal + // paint, so scroll events are identified as changes to the horizontal or + // vertical start value. + + // scroll - startres and endres both change + if (eventName.equals(ViewportRanges.STARTRES)) + { + if (av.getWrapAlignment()) + { + fastPaintWrapped(scrollX); } - else if (eventName.equals(ViewportRanges.STARTSEQ)) + else { - // scroll - fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue()); + fastPaint(scrollX, 0); } } + else if (eventName.equals(ViewportRanges.STARTSEQ)) + { + // scroll + fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue()); + } } /** -- 1.7.10.2