Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / gui / ScalePanel.java
index b95c569..9c2b42f 100755 (executable)
@@ -131,8 +131,9 @@ public class ScalePanel extends JPanel
     if (evt.isPopupTrigger()) // Mac: mousePressed
     {
       rightMouseButtonPressed(evt, res);
+      return;
     }
-    else if (SwingUtilities.isRightMouseButton(evt) && !Platform.isAMac())
+    if (Platform.isWinRightButton(evt))
     {
       /*
        * defer right-mouse click handling to mouse up on Windows
@@ -141,10 +142,7 @@ public class ScalePanel extends JPanel
        */
       return;
     }
-    else
-    {
-      leftMouseButtonPressed(evt, res);
-    }
+    leftMouseButtonPressed(evt, res);
   }
 
   /**
@@ -278,9 +276,11 @@ public class ScalePanel extends JPanel
     mouseDragging = false;
     ap.getSeqPanel().stopScrolling();
 
+    // todo res calculation should be a method on AlignViewport
     int xCords = Math.max(0, evt.getX()); // prevent negative X coordinates
     int res = (xCords / av.getCharWidth())
             + av.getRanges().getStartRes();
+
     if (av.hasHiddenColumns())
     {
       res = av.getAlignment().getHiddenColumns()
@@ -366,6 +366,7 @@ public class ScalePanel extends JPanel
   {
     if (mouseDragging)
     {
+      mouseDragging = false;
       ap.getSeqPanel().stopScrolling();
     }
   }
@@ -426,7 +427,7 @@ public class ScalePanel extends JPanel
   @Override
   public void paintComponent(Graphics g)
   {
-    super.paintComponent(g);
+    //super.paintComponent(g);  // BH 2019
 
     /*
      * shouldn't get called in wrapped mode as the scale above is