From 0b58954732072f7bf61997994cc9f44195e8dcf5 Mon Sep 17 00:00:00 2001 From: ellson Date: Fri, 25 Feb 2005 05:57:42 +0000 Subject: [PATCH] eliminate job->size and job->offset --- lib/common/emit.c | 22 ++++++++-------------- lib/gvc/gvcint.h | 2 -- lib/gvc/gvrender.c | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index b0624b1eb..02553ebba 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -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 } diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index 4cdfbb2ea..8de2b2485 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -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 diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 0fb9b158a..b787afea4 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -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 } -- 2.40.0