From: Matthew Fernandez Date: Thu, 18 Aug 2022 02:31:44 +0000 (-0700) Subject: dotgen _dot_splines: fix truncation to int during intermediate calculations X-Git-Tag: 6.0.1~33^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7813eaa43b5151137ead1214f9ae794cb835d7b3;p=graphviz dotgen _dot_splines: fix truncation to int during intermediate calculations Like the prior commit, the problem fixed in this commit seems to have been a mistake in ebd6191b0eec6e23d96c92aaa06212de339207e3 in not updating these variables to doubles when transitioning to double-based points. Squashes 5 -Wfloat-conversion warnings. --- diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index bc8de6884..a8f6027ec 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -488,7 +488,8 @@ static void _dot_splines(graph_t * g, int normalize) free (edgelist); } else if (agtail(e0) == aghead(e0)) { - int b, sizey, r; + int b, r; + double sizey; n = agtail(e0); r = ND_rank(n); if (r == GD_maxrank(g)) { @@ -501,8 +502,8 @@ static void _dot_splines(graph_t * g, int normalize) sizey = ND_coord(n).y - ND_coord(GD_rank(g)[r+1].v[0]).y; } else { - int upy = ND_coord(GD_rank(g)[r-1].v[0]).y - ND_coord(n).y; - int dwny = ND_coord(n).y - ND_coord(GD_rank(g)[r+1].v[0]).y; + double upy = ND_coord(GD_rank(g)[r-1].v[0]).y - ND_coord(n).y; + double dwny = ND_coord(n).y - ND_coord(GD_rank(g)[r+1].v[0]).y; sizey = MIN(upy, dwny); } makeSelfEdge(edges, ind, cnt, sd.Multisep, sizey / 2, &sinfo);