JAL-3560 avoiding Graphics.setClip
[jalview.git] / src / jalview / appletgui / SeqCanvas.java
index f055776..ecb0888 100755 (executable)
@@ -492,15 +492,17 @@ public class SeqCanvas extends Panel implements ViewportListenerI
                   { ypos - (avcharHeight / 2), ypos - (avcharHeight / 2), ypos - (avcharHeight / 2) + 8 }, 3);
         }
       }
-  
+      // BH 2020.03.19 avoiding g.setClip at all costs
+      g = g.create();
       if (g.getClip() == null)
       {
-        g.setClip(0, 0, cWidth * avcharWidth, canvasHeight);
+        g.clipRect(0, 0, cWidth * avcharWidth, canvasHeight);
       }
   
       drawPanel(g, startRes, endx, 0, al.getHeight() - 1, ypos);
-      g.setClip(null);
+      // g.setClip(null);
   
+      g.dispose();
       if (av.isShowAnnotation())
       {
         g.translate(0, cHeight + ypos + 4);