From 39c75a538db29f199f1c1a7234dea7b43b50beeb Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 3 Apr 2021 12:31:08 -0700 Subject: [PATCH] add a return value to layout Related to #1801. --- lib/fdpgen/layout.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index f7aace78a..c13ab7fb9 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -830,8 +830,7 @@ setClustNodes(graph_t* root) * Add edges per components to get better packing, rather than * wait until the end. */ -static -void layout(graph_t * g, layout_info * infop) +static int layout(graph_t * g, layout_info * infop) { point *pts = NULL; graph_t *dg; @@ -869,7 +868,10 @@ void layout(graph_t * g, layout_info * infop) if (ND_clust(n)) { pointf pt; sg = expandCluster(n, cg); /* attach ports to sg */ - layout(sg, infop); + int r = layout(sg, infop); + if (r != 0) { + return r; + } ND_width(n) = BB(sg).UR.x; ND_height(n) = BB(sg).UR.y; pt.x = POINTS_PER_INCH * BB(sg).UR.x; @@ -950,6 +952,8 @@ void layout(graph_t * g, layout_info * infop) #ifdef DEBUG decInd(); #endif + + return 0; } /* setBB; -- 2.40.0