{ 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);
public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
Graphics g) throws PrinterException
{
+
int annotationHeight = 0;
if (av.isShowAnnotation())
{
int totalHeight = cHeight * (maxwidth / resWidth + 1);
+ g = g.create();
+
g.setColor(Color.white);
g.fillRect(0, 0, pageWidth, pageHeight);
g.setFont(av.getFont());
*/
g.translate(0, -pageNumber * pageHeight);
- g.setClip(0, pageNumber * pageHeight, pageWidth, pageHeight);
+ // BH 2020.03.19 avoiding g.setClip
+ g.clipRect(0, pageNumber * pageHeight, pageWidth, pageHeight);
/*
* draw sequence ids and annotation labels (if shown)
getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth,
totalHeight, 0);
+ g.dispose();
if ((pageNumber * pageHeight) < totalHeight)
{
return Printable.PAGE_EXISTS;
public int print(Graphics pg, PageFormat pf, int pi)
throws PrinterException
{
- pg.setFont(font);
- pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
int pwidth = (int) pf.getImageableWidth();
int pheight = (int) pf.getImageableHeight();
pwidth = getWidth();
}
+ pg = pg.create();
+ pg.setFont(font);
+ pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
+
if (fitToWindow)
{
if (pheight > getHeight())
FontMetrics fm = pg.getFontMetrics(font);
int height = fm.getHeight() * nameHash.size();
pg.translate(0, -pi * pheight);
- pg.setClip(0, pi * pheight, pwidth, (pi * pheight) + pheight);
+ // BH 2020.03.19 avoiding setClip here
+ pg.clipRect(0, pi * pheight, pwidth, (pi * pheight) + pheight);
// translate number of pages,
// height is screen size as this is the
draw(pg, pwidth, pheight);
+ pg.dispose();
+
return Printable.PAGE_EXISTS;
}