From: ellson Date: Tue, 18 Jul 2006 21:04:44 +0000 (+0000) Subject: refix bug that was in 2.8, was fixed, then reintroduced with pdf fixes. X-Git-Tag: LAST_LIBGRAPH~32^2~6061 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1a0ee881687de86161f26a47e61fda6428fb369;p=graphviz refix bug that was in 2.8, was fixed, then reintroduced with pdf fixes. UR coord of setpagedevice was short by the margin size. --- diff --git a/plugin/core/gvrender_core_ps.c b/plugin/core/gvrender_core_ps.c index 6b6393593..7339291db 100644 --- a/plugin/core/gvrender_core_ps.c +++ b/plugin/core/gvrender_core_ps.c @@ -117,14 +117,11 @@ static void psgen_begin_layer(GVJ_t * job, char *layername, int layerNum, int nu static void psgen_begin_page(GVJ_t * job) { box pbr = job->pageBoundingBox; - point sz; // FIXME point page = {0,0}; int N_pages = 0; - sz.x = pbr.UR.x - pbr.LL.x; - sz.y = pbr.UR.y - pbr.LL.y; fprintf(job->output_file, "%%%%Page: %d %d\n", job->common->viewNum + 1, job->common->viewNum + 1); if (job->common->show_boxes == NULL) @@ -134,10 +131,10 @@ static void psgen_begin_page(GVJ_t * job) (job->rotation ? "Landscape" : "Portrait")); if (job->render.id == FORMAT_PS2) fprintf(job->output_file, "<< /PageSize [%d %d] >> setpagedevice\n", - sz.x, sz.y); + pbr.UR.x, pbr.UR.y); if (job->common->show_boxes == NULL) fprintf(job->output_file, "gsave\n%d %d %d %d boxprim clip newpath\n", - pbr.LL.x, pbr.LL.y, sz.x, sz.y); + pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y); fprintf(job->output_file, "%d %d %d beginpage\n", page.x, page.y, N_pages); fprintf(job->output_file, "%g %g set_scale %d rotate %g %g translate\n", job->scale.x, job->scale.y, @@ -146,10 +143,10 @@ static void psgen_begin_page(GVJ_t * job) /* Define the size of the PS canvas */ if (job->render.id == FORMAT_PS2) { - if (sz.x >= PDFMAX || sz.y >= PDFMAX) + if (pbr.UR.x >= PDFMAX || pbr.UR.y >= PDFMAX) job->common->errorfn("canvas size (%d,%d) exceeds PDF limit (%d)\n" "\t(suggest setting a bounding box size, see dot(1))\n", - sz.x, sz.y, PDFMAX); + pbr.UR.x, pbr.UR.y, PDFMAX); fprintf(job->output_file, "[ /CropBox [%d %d %d %d] /PAGES pdfmark\n", pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y); }