From c405a33ff4ec5b2eec7c55703b9b6dabfd59c4fb Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 18 Oct 2005 18:28:58 +0000 Subject: [PATCH] Put back magins in Postscript BoundingBox. Default now to 5 points. --- lib/common/const.h | 3 ++- lib/common/psgen.c | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/common/const.h b/lib/common/const.h index 549ced00f..12f0d7c58 100644 --- a/lib/common/const.h +++ b/lib/common/const.h @@ -86,7 +86,8 @@ #define MIN_RANKSEP 0.02 /* default margin for paged formats such as PostScript */ -#define DEFAULT_MARGIN 36 +/* #define DEFAULT_MARGIN 36 */ +#define DEFAULT_MARGIN 5 /* default margin for embedded formats such as PNG */ #define DEFAULT_EMBED_MARGIN 5 diff --git a/lib/common/psgen.c b/lib/common/psgen.c index aedde1419..034c25310 100644 --- a/lib/common/psgen.c +++ b/lib/common/psgen.c @@ -107,12 +107,17 @@ static void ps_comment(char *str) static void ps_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb) { char *s; + point sz; PB = bb; + /* PB (in the case of a single page graph) is the graph bb offset + * at PB.LL by the B & L margin width. + * The PostScript BoundingBox also needs margin T & R */ + sz = add_points(PB.LL, PB.UR); if (onetime) { if (Show_boxes == NULL) fprintf(Output_file, "%%%%BoundingBox: %d %d %d %d\n", - PB.LL.x, PB.LL.y, PB.UR.x, PB.UR.y); + 0, 0, sz.x, sz.y); fprintf(Output_file, "%%%%EndComments\nsave\n"); cat_libfile(Output_file, U_lib, ps_txt); epsf_define(Output_file); -- 2.50.1