From 009176c374a212582ccfdbf77366eafcd0f62a68 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 4 Oct 2019 10:31:17 +0100 Subject: [PATCH] JAL-3345 small simplification --- src/jalview/gui/ScalePanel.java | 3 +-- src/jalview/gui/SeqPanel.java | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 87f350b..5271da2 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -447,7 +447,6 @@ public class ScalePanel extends JPanel } } - // scalewidth will normally be screenwidth, public void drawScale(Graphics g, int startx, int endx, int width, int height) { @@ -593,7 +592,7 @@ public class ScalePanel extends JPanel } } - public boolean isMouseDragging() + boolean isMouseDragging() { return mouseDragging; } diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 134e284..b188888 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -224,7 +224,7 @@ public class SeqPanel extends JPanel SearchResultsI lastSearchResults; /** - * Create a new SeqPanel. + * Constructor * * @param viewport * @param alignPanel @@ -1953,13 +1953,9 @@ public class SeqPanel extends JPanel * start scrolling if mouse dragging, whether the drag started * in the scale panel or this panel */ - if (ap.getScalePanel().isMouseDragging()) + if (mouseDragging || ap.getScalePanel().isMouseDragging()) { - ap.getScalePanel().mouseExited(e); - } - else if (mouseDragging && scrollThread == null) - { - startScrolling(e.getPoint()); + startScrolling(new Point(e.getX(), 0)); } } -- 1.7.10.2