JAL-4260 right align the annotation labels regardless of width in wrapped mode.
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index a3f7e00..08a25ba 100755 (executable)
@@ -1246,7 +1246,7 @@ public class AnnotationLabels extends JPanel
     else
     {
       int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null, false);
-      width = Math.max(newAnnotationIdWidth, givenWidth);
+      width = newAnnotationIdWidth<givenWidth ? givenWidth: Math.min(newAnnotationIdWidth, givenWidth);
     }
     drawLabels(g, clip, width, true, forGUI, null, false);
   }
@@ -1554,7 +1554,7 @@ public class AnnotationLabels extends JPanel
       }
     }
 
-    if (!resizePanel && dragEvent != null && aa != null)
+    if (!resizePanel && dragEvent != null && aa != null && selectedRow>-1 && selectedRow<aa.length)
     {
       if (actuallyDraw && g != null)
       {