diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-15 08:11:46 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-15 08:11:46 +0000 |
commit | 54ff093a1c8f485045842e50abe246a94efa986b (patch) | |
tree | 870ecf907717886cbf0ab7eedb9f63795bea061b /src/java/org | |
parent | aec5e88d94f4c903b5e30ffff0bec7fa168e46c7 (diff) | |
download | xmlgraphics-fop-54ff093a1c8f485045842e50abe246a94efa986b.tar.gz xmlgraphics-fop-54ff093a1c8f485045842e50abe246a94efa986b.zip |
Avoid painting empty rectangles because that can lead to unwanted artifacts.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@344330 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFRenderer.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/ps/PSRenderer.java | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 1d70952f7..ec6b6f152 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -738,7 +738,9 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { * @see org.apache.fop.render.AbstractPathOrientedRenderer#fillRect(float, float, float, float) */ protected void fillRect(float x, float y, float w, float h) { - currentStream.add(x + " " + y + " " + w + " " + h + " re f\n"); + if (w != 0 && h != 0) { + currentStream.add(x + " " + y + " " + w + " " + h + " re f\n"); + } } /** diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index 5c43050d0..0f7da6b02 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -226,11 +226,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer { /** @see org.apache.fop.render.AbstractPathOrientedRenderer */ protected void fillRect(float x, float y, float width, float height) { - try { - gen.defineRect(x, y, width, height); - gen.writeln("fill"); - } catch (IOException ioe) { - handleIOTrouble(ioe); + if (width != 0 && height != 0) { + try { + gen.defineRect(x, y, width, height); + gen.writeln("fill"); + } catch (IOException ioe) { + handleIOTrouble(ioe); + } } } |