]> granicus.if.org Git - graphviz/commitdiff
fix problem with black dots around white background in bitmap outputs
authorellson <devnull@localhost>
Thu, 27 Oct 2005 15:45:20 +0000 (15:45 +0000)
committerellson <devnull@localhost>
Thu, 27 Oct 2005 15:45:20 +0000 (15:45 +0000)
lib/common/emit.c

index e8fb79dadc806e027d8d996f2ce6251b88b65d62..9bd39fea3f02b14052a86355792398d81f84f61a 100644 (file)
@@ -362,10 +362,13 @@ void emit_background(GVJ_t * job, graph_t *g)
 
     if (! ((str = agget(g, "bgcolor")) && str[0]))
        str = "white";
-    AF[0].x = AF[1].x = job->pageBox.LL.x;
-    AF[2].x = AF[3].x = job->pageBox.UR.x;
-    AF[1].y = AF[2].y = job->pageBox.UR.y;
-    AF[3].y = AF[0].y = job->pageBox.LL.y;
+    /* need to make background rectangle bigger than the page
+     * otherwise black dots show up from the antialising of the edge
+     * in bitmap outputs */
+    AF[0].x = AF[1].x = job->pageBox.LL.x - 1;
+    AF[2].x = AF[3].x = job->pageBox.UR.x + 1;
+    AF[3].y = AF[0].y = job->pageBox.LL.y - 1;
+    AF[1].y = AF[2].y = job->pageBox.UR.y + 1;
     for (i = 0; i < 4; i++) {
        PF2P(AF[i],A[i]);
     }