import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
-import java.awt.Shape;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.util.Iterator;
ranges.getEndRes(), ranges.getStartSeq(), ranges.getEndSeq());
g.drawImage(img, 0, 0, this);
+ gg.dispose();
}
if (av.cursorMode)
+ ((startColumn - ranges.getStartRes()) % viewportWidth)
* charWidth;
- // 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
-
g.translate(xOffset, 0);
- // When printing we have an extra clipped region,
- // the Printable page which we need to account for here
- Shape clip = g.getClip();
- if (clip == null)
- {
- g.setClip(0, 0, viewportWidth * charWidth, canvasHeight);
- }
- else
- {
- g.setClip(0, (int) clip.getBounds().getY(),
- viewportWidth * charWidth, (int) clip.getBounds().getHeight());
- }
-
-
/*
* white fill the region to be drawn (so incremental fast paint doesn't
* scribble over an existing image)
startColumn, endx + 1);
g.translate(0, -cHeight - ypos - 3);
}
- // g.dispose();
g.translate(-xOffset, 0);
-// g.setClip(clip);
}
/**