JAL-2665 Correct position of selection switching from wrap to normal
authorkiramt <k.mourao@dundee.ac.uk>
Thu, 17 Aug 2017 08:02:34 +0000 (09:02 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Thu, 17 Aug 2017 08:02:34 +0000 (09:02 +0100)
src/jalview/gui/SeqCanvas.java

index 9bd38c5..0b0166b 100755 (executable)
@@ -1053,6 +1053,12 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
       return null;
     }
     
+    if (!av.getWrapAlignment())
+    {
+      LABEL_EAST = 0;
+      LABEL_WEST = 0;
+    }
+
     // set up drawing colour
     Graphics2D g = (Graphics2D) selectionImage.getGraphics();
     g.translate(LABEL_WEST, 0);
@@ -1119,6 +1125,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
       }
     }
     g.translate(-LABEL_WEST, 0);
+    g.dispose();
     return selectionImage;
   }