imgWidth -= (imgWidth % charWidth);
imgHeight -= (imgHeight % charHeight);
- BufferedImage newimg = new BufferedImage(imgWidth, imgHeight,
- BufferedImage.TYPE_INT_ARGB);
+ if ((imgWidth > 0) && (imgHeight > 0))
+ {
+ BufferedImage newimg = new BufferedImage(imgWidth, imgHeight,
+ BufferedImage.TYPE_INT_ARGB);
- gg = (Graphics2D) newimg.getGraphics();
- gg.setFont(av.getFont());
- gg.drawImage(img, null, 0, 0);
- img = newimg;
+ gg = (Graphics2D) newimg.getGraphics();
+ gg.setFont(av.getFont());
+ gg.drawImage(img, null, 0, 0);
+ img = newimg;
- if (horizontal != 0)
- {
- transX = (er - horizontal - sr) * charWidth;
- sr = er - horizontal - sr;
- }
- else if (vertical != 0)
- {
- transY = imgHeight - ((vertical + 1) * charHeight);
- ss = es - vertical - ss;
+ if (horizontal != 0)
+ {
+ transX = (er - horizontal - sr) * charWidth;
+ sr = er - horizontal - sr;
+ }
+ else if (vertical != 0)
+ {
+ transY = imgHeight - ((vertical + 1) * charHeight);
+ ss = es - vertical - ss;
+ }
}
}
else