}
}
+ /* pad */
+ gvc->graph_sets_pad = FALSE;
+ if ((p = agget(g, "pad"))) {
+ i = sscanf(p, "%lf,%lf", &xf, &yf);
+ if (i > 0) {
+ gvc->pad.x = gvc->pad.y = xf * POINTS_PER_INCH;
+ if (i > 1)
+ gvc->pad.y = yf * POINTS_PER_INCH;
+ gvc->graph_sets_pad = TRUE;
+ }
+ }
+
/* pagesize */
gvc->graph_sets_pageSize = FALSE;
P2PF(GD_drawing(g)->page, gvc->pageSize);
static void init_job_pad(GVJ_t *job)
{
- switch (job->output_lang) {
- case GVRENDER_PLUGIN:
- job->pad.x = job->pad.y = job->render.features->default_pad;
- break;
- default:
- job->pad.x = job->pad.y = DEFAULT_GRAPH_PAD;
- break;
+ GVC_t *gvc = job->gvc;
+
+ if (gvc->graph_sets_pad) {
+ job->pad = gvc->pad;
+ }
+ else {
+ switch (job->output_lang) {
+ case GVRENDER_PLUGIN:
+ job->pad.x = job->pad.y = job->render.features->default_pad;
+ break;
+ default:
+ job->pad.x = job->pad.y = DEFAULT_GRAPH_PAD;
+ break;
+ }
}
}
/* pagination */
char *pagedir; /* pagination order */
pointf margin; /* margins in graph units */
+ pointf pad; /* pad in graph units */
pointf pageSize; /* pageSize in graph units, not including margins */
point pb; /* page size - including margins (inches) */
boxf bb; /* graph bb in graph units, not including margins */
int rotation; /* rotation - 0 = portrait, 90 = landscape */
- boolean graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
+ boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
/* layers */
char *layerDelims; /* delimiters in layer names */