From: ellson Date: Sun, 8 Jan 2006 21:34:07 +0000 (+0000) Subject: simplify Pad calculations X-Git-Tag: LAST_LIBGRAPH~32^2~6881 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df6cdc18a502442d11913b87044f723385fea45f;p=graphviz simplify Pad calculations --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 97317699c..d7546fd19 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -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;