]> granicus.if.org Git - graphviz/commitdiff
eliminate job->size and job->offset
authorellson <devnull@localhost>
Fri, 25 Feb 2005 05:57:42 +0000 (05:57 +0000)
committerellson <devnull@localhost>
Fri, 25 Feb 2005 05:57:42 +0000 (05:57 +0000)
lib/common/emit.c
lib/gvc/gvcint.h
lib/gvc/gvrender.c

index b0624b1ebe29fe8894f167ee93bc17a98a0682c3..02553ebbadb3d39e6902349fd2cff2b63b9fff1e 100644 (file)
@@ -209,7 +209,7 @@ static void init_job_pagination(GVC_t * gvc, graph_t * g)
     gvrender_job_t *job = gvc->job;
     pointf pageSizeCenteredLessMargins;         /* page for centering less margins - graph units*/
     pointf deviceSize;                 /* device size for a page of the graph - graph units */
-    pointf extra;
+    pointf extra, size;
 
     /* determine desired device size in graph units */
     deviceSize.x = job->width * POINTS_PER_INCH / job->dpi;
@@ -268,14 +268,12 @@ fprintf(stderr,"graph_sets_pageSize\n");
 
     job->boundingBox.LL.x = ROUND((job->margin.x + extra.x) * job->dpi / POINTS_PER_INCH);
     job->boundingBox.LL.y = ROUND((job->margin.y + extra.y) * job->dpi / POINTS_PER_INCH);
-    job->size.x = ROUND(job->pageSize.x * job->dpi / POINTS_PER_INCH);
-    job->size.y = ROUND(job->pageSize.y * job->dpi / POINTS_PER_INCH);
+    size.x = job->pageSize.x * job->dpi / POINTS_PER_INCH;
+    size.y = job->pageSize.y * job->dpi / POINTS_PER_INCH;
     if (GD_drawing(g)->landscape)
-       job->size = exch_xy(job->size);
-    job->boundingBox.UR.x = job->boundingBox.LL.x + job->size.x;
-    job->boundingBox.UR.y = job->boundingBox.LL.y + job->size.y;
-    job->offset.x = job->boundingBox.LL.x;
-    job->offset.y = job->boundingBox.LL.y;
+       size = exch_xyf(size);
+    job->boundingBox.UR.x = job->boundingBox.LL.x + ROUND(size.x + 1);
+    job->boundingBox.UR.y = job->boundingBox.LL.y + ROUND(size.y + 1);
 
 #if 0
 fprintf(stderr,"bb = %g,%g %g,%g (graph units)\n",
@@ -295,13 +293,9 @@ fprintf(stderr,"boundingBox = %d,%d %d,%d (device units)\n",
         job->boundingBox.LL.y,
         job->boundingBox.UR.x,
         job->boundingBox.UR.y);
-fprintf(stderr,"width,height = %d,%d size = %d,%d offset = %d,%d (device units)\n",
+fprintf(stderr,"width,height = %d,%d (device units)\n",
         job->width,
-        job->height,
-        job->size.x,
-        job->size.y,
-        job->offset.x,
-        job->offset.y);
+        job->height);
 #endif
 }
 
index 4cdfbb2eace57ecfa50a889f4d01ac4df6f12045..8de2b248516701373cabeb645107d1238d1661f6 100644 (file)
@@ -108,8 +108,6 @@ extern "C" {
        pointf focus;           /* viewport focus in graph units */
        box     boundingBox;    /* drawable region in device units */
 
-       point   offset;          /* offset into device in device coords */
-       point   size;            /* size of device in device coords */
 #if 0
        pointf pointer;         /* pointer position in graph units */
 #endif
index 0fb9b158a5b9c41314ea439474c6d7db8c379d96..b787afea4f78bcc3fb9689f5cc7537a1b706ff40 100644 (file)
@@ -346,7 +346,7 @@ void gvrender_begin_page(GVC_t * gvc)
        codegen_t *cg = job->codegen;
 
        if (cg && cg->begin_page)
-           cg->begin_page(job->g, job->pagesArrayElem, job->zoom, job->rotation, job->offset);
+           cg->begin_page(job->g, job->pagesArrayElem, job->zoom, job->rotation, job->boundingBox.LL);
     }
 #endif
 }