+
+ // BH 2018 note: I have switched to using Graphics.create() here because it is
+ // more reliable (and simpler) to reset. The difference seems to be that SwingJS
+ // automatically sets a clipping region on an image to be the image dimensions, whereas
+ // Java sets no clip for an image. (A bug? Go figure!)
+ // Since we are using an off-screen BufferedImage here, the result is that g.getClip()
+ // returns non-null in JavaScript but not Java.
+ //
+ // Anyway, this works and, I suggest, is better design anyway.
+ //
+ // Graphics g = gg.create();
+ // mc 30/08/18 undone because gnu.jpdf.PDFGraphics doesn't handle
+ // get/setTransform
+