diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-05-31 14:54:02 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-05-31 14:54:02 +0000 |
commit | d067157a185e8e1ddc77cca58cc37d251bf1effc (patch) | |
tree | 448a00019ebd079246afc45ea6c992244707f324 | |
parent | 4a1c328850ef3e44f35b164de6c67565a0705b9f (diff) | |
download | xmlgraphics-fop-d067157a185e8e1ddc77cca58cc37d251bf1effc.tar.gz xmlgraphics-fop-d067157a185e8e1ddc77cca58cc37d251bf1effc.zip |
Forgot something.
Round up on the bitmap size.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@410550 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java index e7b126121..e025f0c5e 100644 --- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java @@ -52,8 +52,8 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { */ protected BufferedImage paintToBufferedImage(Graphics2DImagePainter painter, RendererContextWrapper context, int resolution, boolean gray, boolean withAlpha) { - int bmw = UnitConv.mpt2px(context.getWidth(), resolution); - int bmh = UnitConv.mpt2px(context.getHeight(), resolution); + int bmw = (int)Math.ceil(UnitConv.mpt2px(context.getWidth(), resolution)); + int bmh = (int)Math.ceil(UnitConv.mpt2px(context.getHeight(), resolution)); BufferedImage bi; if (gray) { if (withAlpha) { @@ -79,6 +79,13 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { if (!withAlpha) { g2d.clearRect(0, 0, bmw, bmh); } + /* debug code + int off = 2; + g2d.drawLine(off, 0, off, bmh); + g2d.drawLine(bmw - off, 0, bmw - off, bmh); + g2d.drawLine(0, off, bmw, off); + g2d.drawLine(0, bmh - off, bmw, bmh - off); + */ double sx = (double)bmw / context.getWidth(); double sy = (double)bmh / context.getHeight(); g2d.scale(sx, sy); |