]> granicus.if.org Git - graphviz/commitdiff
fix missing nodes in -Tps and other cg
authorellson <devnull@localhost>
Wed, 4 May 2005 12:46:37 +0000 (12:46 +0000)
committerellson <devnull@localhost>
Wed, 4 May 2005 12:46:37 +0000 (12:46 +0000)
    caused by clip box not initialized for cg

lib/common/emit.c
lib/gvc/gvrender.c

index e93d40a14ab925032c5f8e09ed1140158916c678..0590420efd07d8ccfb46f184f8e39b0afe312582 100644 (file)
@@ -427,6 +427,7 @@ fprintf(stderr,"pagesArrayElem = %d,%d pageSize = %g,%g pageOffset = %g,%g\n",
     emit_defaults(job);
 }
 
+#if 0
 static boolean node_in_view(GVJ_t *job, node_t * n)
 {
     boxf b;
@@ -440,6 +441,7 @@ static boolean node_in_view(GVJ_t *job, node_t * n)
 
     return boxf_overlap(job->pageBoxClip, b);
 }
+#endif
 
 static boolean is_natural_number(char *sstr)
 {
@@ -566,8 +568,7 @@ static boolean clust_in_layer(GVJ_t *job, graph_t * sg)
     return FALSE;
 }
 
-#if 0
-/* ND_bb(n) not set early enough to use in layout */
+#if 1
 static boolean node_in_box(node_t *n, boxf b)
 {
     return boxf_overlap(ND_bb(n), b);
@@ -583,7 +584,7 @@ static void emit_node(GVJ_t * job, node_t * n)
        return;
 
     if (node_in_layer(job, n->graph, n)
-           && node_in_view(job, n)
+           && node_in_box(n, job->pageBoxClip)
            && (ND_state(n) != gvc->viewNum)) {
 
         gvrender_comment(job, n->name);
@@ -683,6 +684,7 @@ static void emit_attachment(GVJ_t * job, textlabel_t * lp, splines * spl)
     gvrender_polyline(job, A, 3);
 }
 
+#if 0
 static boolean edge_in_view(GVJ_t *job, edge_t * e)
 {
     int i, j, np;
@@ -720,6 +722,7 @@ static boolean edge_in_view(GVJ_t *job, edge_t * e)
     b.UR.y = lp->p.y + sy;
     return boxf_overlap(job->pageBoxClip, b);
 }
+#endif
 
 void emit_edge_graphics(GVJ_t * job, edge_t * e)
 {
@@ -894,8 +897,7 @@ void emit_edge_graphics(GVJ_t * job, edge_t * e)
        gvrender_end_context(job);
 }
 
-#if 0
-/* ED_spl(e).bb not set early enough to use in layout */
+#if 1
 static boolean edge_in_box(edge_t *e, boxf b)
 {
     splines *spl;
@@ -918,7 +920,7 @@ static void emit_edge(GVJ_t * job, edge_t * e)
     char *s, *url = NULL, *label = NULL, *tooltip = NULL, *target = NULL;
     textlabel_t *lab = NULL;
 
-    if (! edge_in_view(job, e) || ! edge_in_layer(job, e->head->graph, e))
+    if (! edge_in_box(e, job->pageBoxClip) || ! edge_in_layer(job, e->head->graph, e))
        return;
 
     s = malloc(strlen(e->tail->name) + 2 + strlen(e->head->name) + 1);
index 4ba863f27fe685e10b215c7ff0a0d6c6bb91ec8e..389a2523d5adb611f6ed1b4e1f65c65b6e10e6ce 100644 (file)
@@ -247,19 +247,19 @@ void gvrender_begin_graph(GVJ_t * job, graph_t * g)
     char *str;
     double sx, sy;
 
+    sx = job->width / (job->zoom * 2.);
+    sy = job->height / (job->zoom * 2.);
+    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->sg = g;  /* current subgraph/cluster */
     if (gvre) {
        job->compscale.x = job->zoom * job->dpi / POINTS_PER_INCH;
        job->compscale.y = job->compscale.x *
            ((job->render_features->flags & GVRENDER_Y_GOES_DOWN) ? -1.0 : 1.0);
 
-        sx = job->width / (job->zoom * 2.);
-        sy = job->height / (job->zoom * 2.);
-       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;
-
        /* render specific init */
        if (gvre->begin_graph)
            gvre->begin_graph(job, gvc->graphname);