From: gmungoc Date: Fri, 4 Oct 2019 09:31:17 +0000 (+0100) Subject: JAL-3345 small simplification X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=009176c374a212582ccfdbf77366eafcd0f62a68;p=jalview.git JAL-3345 small simplification --- 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)); } }