From 96be06475ce2c2f9f59452489f18250d948b9690 Mon Sep 17 00:00:00 2001 From: ellson Date: Sat, 29 Jul 2006 20:36:04 +0000 Subject: [PATCH] eliminate job->offset as it is no longer used --- lib/common/emit.c | 25 ++++++++++--------------- lib/gvc/gvcjob.h | 1 - 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index d45ee811b..e4599e431 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -378,12 +378,11 @@ static void setup_page(GVJ_t * job, graph_t * g) else job->translation.y = -job->pageBox.LL.y + job->pageBoundingBox.LL.y / job->scale.y; } + + job->compscale = job->scale; + job->compscale.y *= (job->flags & GVRENDER_Y_GOES_DOWN) ? -1. : 1.; job->comptrans = job->translation; job->comptrans.y *= (job->flags & GVRENDER_Y_GOES_DOWN) ? -1: 1; - - gvrender_begin_page(job); - gvrender_set_pencolor(job, DEFAULT_COLOR); - gvrender_set_fillcolor(job, DEFAULT_FILL); } #if 0 @@ -1142,29 +1141,23 @@ static void setup_view(GVJ_t * job, graph_t * g) job->width = ROUND((job->view.x + 2 * job->margin.x) * job->dpi.x / POINTS_PER_INCH); job->height = ROUND((job->view.y + 2 * job->margin.y) * job->dpi.y / POINTS_PER_INCH); - job->compscale.x = job->scale.x = job->zoom * job->dpi.x / POINTS_PER_INCH; - job->compscale.y = job->scale.y = job->zoom * job->dpi.y / POINTS_PER_INCH; - job->compscale.y *= (job->flags & GVRENDER_Y_GOES_DOWN) ? -1. : 1.; + job->scale.x = job->zoom * job->dpi.x / POINTS_PER_INCH; + job->scale.y = job->zoom * job->dpi.y / POINTS_PER_INCH; sx = job->width / (job->scale.x * 2.); sy = job->height / (job->scale.y * 2.); - /* calculate clip region in graph units - * calculate offset to 0,0 of graph in device units */ + /* calculate clip region in graph units */ if (job->rotation) { job->clip.UR.x = job->focus.x + sy + EPSILON; job->clip.UR.y = job->focus.y + sx + EPSILON; job->clip.LL.x = job->focus.x - sy - EPSILON; job->clip.LL.y = job->focus.y - sx - EPSILON; - job->offset.x = -job->focus.y * job->compscale.x + job->width * 3 / 2; - job->offset.y = -job->focus.x * job->compscale.y + job->height / 2.; } else { job->clip.UR.x = job->focus.x + sx + EPSILON; job->clip.UR.y = job->focus.y + sy + EPSILON; job->clip.LL.x = job->focus.x - sx - EPSILON; job->clip.LL.y = job->focus.y - sy - EPSILON; - job->offset.x = -job->focus.x * job->compscale.x + job->width / 2.; - job->offset.y = -job->focus.y * job->compscale.y + job->height / 2.; } } @@ -1309,10 +1302,12 @@ void emit_graph(GVJ_t * job, graph_t * g) for (firstpage(job); validpage(job); nextpage(job)) { setColorScheme (agget (g, "colorscheme")); setup_page(job, g); - if (job->numLayers == 1) - emit_background(job, g); + gvrender_begin_page(job); gvrender_set_pencolor(job, DEFAULT_COLOR); + gvrender_set_fillcolor(job, DEFAULT_FILL); gvrender_set_font(job, gvc->defaultfontname, gvc->defaultfontsize); + if (job->numLayers == 1) + emit_background(job, g); if (boxf_overlap(job->clip, job->pageBox)) emit_view(job,g,flags); } diff --git a/lib/gvc/gvcjob.h b/lib/gvc/gvcjob.h index 9b97de7c1..84ef73559 100644 --- a/lib/gvc/gvcjob.h +++ b/lib/gvc/gvcjob.h @@ -267,7 +267,6 @@ extern "C" { pointf translation; /* composite translation */ pointf compscale; /* composite device scale incl: zoom, dpi, y_goes_down */ pointf comptrans; /* composite translation */ - pointf offset; /* composite translation (used by codegens) */ bool fit_mode, needs_refresh, -- 2.50.1