From ea97ca2654b26f3192cb629d751208a6c09627eb Mon Sep 17 00:00:00 2001 From: erg Date: Thu, 2 Feb 2006 19:23:26 +0000 Subject: [PATCH] Fix incorrect bounding box calculation for flat adjacent edges --- lib/common/splines.c | 2 +- lib/common/utils.h | 1 + lib/dotgen/dotsplines.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/common/splines.c b/lib/common/splines.c index 315f4809b..9fd352488 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -226,7 +226,7 @@ bezier *new_spline(edge_t * e, int sz) * Update the bounding box of g based on the addition of * point p. */ -static void update_bb(graph_t * g, point pt) +void update_bb(graph_t * g, point pt) { if (pt.x > GD_bb(g).UR.x) GD_bb(g).UR.x = pt.x; diff --git a/lib/common/utils.h b/lib/common/utils.h index ee66a3998..e4e14a4d2 100644 --- a/lib/common/utils.h +++ b/lib/common/utils.h @@ -55,6 +55,7 @@ extern "C" { extern int common_init_edge(edge_t * e); extern void updateBB(graph_t * g, textlabel_t * lp); + extern void update_bb(graph_t * g, point p); extern void compute_bb(Agraph_t *); extern bool overlap_node(node_t *n, boxf b); extern bool overlap_label(textlabel_t *lp, boxf b); diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index 0f398acfd..8360b484e 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -869,7 +869,9 @@ make_flat_adj_edges(path* P, edge_t** edges, int ind, int cnt, edge_t* e0) bz->eflag = auxbz->eflag; bz->ep = transform(auxbz->ep, del, GD_flip(g)); for (j = 0; j < auxbz->size; j++) { - bz->list[j] = transform(auxbz->list[j], del, GD_flip(g)); + point pt; + pt = bz->list[j] = transform(auxbz->list[j], del, GD_flip(g)); + update_bb(g, pt); } if (ED_label(e)) { ED_label(e)->p = transform(ED_label(auxe)->p, del, GD_flip(g)); -- 2.40.0