]> granicus.if.org Git - graphviz/commitdiff
eliminate job->offset as it is no longer used
authorellson <devnull@localhost>
Sat, 29 Jul 2006 20:36:04 +0000 (20:36 +0000)
committerellson <devnull@localhost>
Sat, 29 Jul 2006 20:36:04 +0000 (20:36 +0000)
lib/common/emit.c
lib/gvc/gvcjob.h

index d45ee811bdb847e9f650c08fc5faa94bf4103b8a..e4599e4313e28087dc7365d9a67341f23da3b1cc 100644 (file)
@@ -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);
        } 
index 9b97de7c1c56d6569c15984f76c863f69aca61b1..84ef73559dbd4bf5551f81dfdfbac0deaee1ef9a 100644 (file)
@@ -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,