]> granicus.if.org Git - graphviz/commitdiff
simplify Pad calculations
authorellson <devnull@localhost>
Sun, 8 Jan 2006 21:34:07 +0000 (21:34 +0000)
committerellson <devnull@localhost>
Sun, 8 Jan 2006 21:34:07 +0000 (21:34 +0000)
lib/common/emit.c

index 97317699c8614d34efa6485842dbdaba08354cde..d7546fd191c27ffb0f63ee6a65b1458450affd50 100644 (file)
@@ -373,13 +373,10 @@ void emit_background(GVJ_t * job, graph_t *g)
 
     if (! ((str = agget(g, "bgcolor")) && str[0]))
        str = "white";
-    /* 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 - job->margin.x - Pad - 1;
-    AF[2].x = AF[3].x = job->pageBox.UR.x + job->margin.x + Pad + 1;
-    AF[3].y = AF[0].y = job->pageBox.LL.y - job->margin.y - Pad - 1;
-    AF[1].y = AF[2].y = job->pageBox.UR.y + job->margin.y + Pad + 1;
+    AF[0].x = AF[1].x = job->pageBox.LL.x;
+    AF[2].x = AF[3].x = job->pageBox.UR.x;
+    AF[3].y = AF[0].y = job->pageBox.LL.y;
+    AF[1].y = AF[2].y = job->pageBox.UR.y;
     for (i = 0; i < 4; i++) {
        PF2P(AF[i],A[i]);
     }
@@ -410,6 +407,11 @@ static void setup_page(GVJ_t * job, graph_t * g)
     job->pageBox.LL = sub_pointfs(job->pageBox.LL,job->margin);
     job->pageBox.UR = add_pointfs(job->pageBox.UR,job->margin);
 
+    job->pageBox.LL.x -= Pad;
+    job->pageBox.LL.y -= Pad;
+    job->pageBox.UR.x -= Pad;
+    job->pageBox.UR.y -= Pad;
+
     /* establish pageOffset to be applied, in graph coordinates */
     if (job->rotation == 0) {
        job->pageOffset.x =  -(job->pagesArrayElem.x)    * job->pageSize.x;