]> granicus.if.org Git - graphviz/commitdiff
last change was too simple - fixing
authorellson <devnull@localhost>
Sun, 1 May 2005 15:44:34 +0000 (15:44 +0000)
committerellson <devnull@localhost>
Sun, 1 May 2005 15:44:34 +0000 (15:44 +0000)
lib/common/emit.c
lib/common/renderprocs.h
lib/common/utils.c

index 75a85d58b91b518504c36721b48eeba73cb40453..9da65e3455d315390f7494de979d0f8157c80243 100644 (file)
@@ -552,6 +552,11 @@ static boolean clust_in_layer(GVJ_t *job, graph_t * sg)
     return FALSE;
 }
 
+static boolean node_in_box(node_t *n, boxf b)
+{
+    return boxf_overlap(ND_bb(n), b);
+}
+
 static void emit_node(GVJ_t * job, node_t * n)
 {
     GVC_t *gvc = job->gvc;
@@ -561,7 +566,7 @@ static void emit_node(GVJ_t * job, node_t * n)
        return;
 
     if (node_in_layer(job, n->graph, n)
-           && overlap_node(n, job->pageBoxClip)
+           && node_in_box(n, job->pageBoxClip)
            && (ND_state(n) != gvc->viewNum)) {
 
         gvrender_comment(job, n->name);
@@ -834,12 +839,28 @@ void emit_edge_graphics(GVJ_t * job, edge_t * e)
        gvrender_end_context(job);
 }
 
+static boolean edge_in_box(edge_t *e, boxf b)
+{
+    splines *spl;
+    textlabel_t *lp;
+
+    spl = ED_spl(e);
+    if (spl && boxf_overlap(spl->bb, b))
+        return TRUE;
+
+    lp = ED_label(e);
+    if (lp && overlap_label(lp, b))
+        return TRUE;
+
+    return FALSE;
+}
+
 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 (! overlap_edge(e, job->pageBoxClip)
+    if (! edge_in_box(e, job->pageBoxClip)
        || ! edge_in_layer(job, e->head->graph, e))
                return;
 
index 5e11ed075051184e2e027e051a5b4a564823602e..2166e97fcf11e357811612ad1d53617bb0f13708 100644 (file)
@@ -154,6 +154,7 @@ extern "C" {
     extern void osize_label(textlabel_t *, int *, int *, int *, int *);
     extern boolean overlap_edge(edge_t *e, boxf b);
     extern boolean overlap_node(node_t *n, boxf b);
+    extern boolean overlap_label(textlabel_t *lp, boxf b);
     extern char **parse_style(char *s);
     extern void place_graph_label(Agraph_t *);
     extern void place_portlabel(edge_t * e, boolean head_p);
index 198389838afee5363a4261c635426b93865d173b..a32492ccbc7f7d8c344fcaa245db8b6c174311d2 100644 (file)
@@ -1903,7 +1903,7 @@ boolean overlap_node(node_t *n, boxf b)
     return TRUE;
 }
 
-static boolean overlap_label(textlabel_t *lp, boxf b)
+boolean overlap_label(textlabel_t *lp, boxf b)
 {
     double sx, sy;
     boxf bb;
@@ -1958,8 +1958,8 @@ boolean overlap_edge(edge_t *e, boxf b)
     }
 
     lp = ED_label(e);
-        if (lp && overlap_label(lp, b))
-            return TRUE;
+    if (lp && overlap_label(lp, b))
+        return TRUE;
 
     return FALSE;
 }