]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Avoid painting empty rectangles because that can lead to unwanted artifacts.
authorJeremias Maerki <jeremias@apache.org>
Tue, 15 Nov 2005 08:11:46 +0000 (08:11 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 15 Nov 2005 08:11:46 +0000 (08:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@344330 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/pdf/PDFRenderer.java
src/java/org/apache/fop/render/ps/PSRenderer.java

index 1d70952f7b8bbf58a8e98ab19167b2743aca906d..ec6b6f152f716083be66b50946271f696862a5ee 100644 (file)
@@ -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");
+        }
     }
     
     /**
index 5c43050d04c92a085457f6a37d3a5ab761274dd6..0f7da6b0274f1e7ad8f5782606f9ecaa15786dda 100644 (file)
@@ -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);
+            }
         }
     }