From: Matthew Fernandez Date: Thu, 18 Aug 2022 02:46:02 +0000 (-0700) Subject: dotgen make_flat_labeled_edge: fix truncation to int during intermediate ops X-Git-Tag: 6.0.1~33^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58f6a7b6051ab9e39ced4d8444c079d3b4739f60;p=graphviz dotgen make_flat_labeled_edge: fix truncation to int during intermediate ops Like the prior commits, 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 1 -Wfloat-conversion warnings. --- diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index 77f829760..c285800d9 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -1468,7 +1468,7 @@ make_flat_labeled_edge(graph_t* g, spline_info_t* sp, path* P, edge_t* e, int et bool ps_needs_free = false; pathend_t tend, hend; boxf lb; - int i, pn, ydelta; + int i, pn; edge_t *f; pointf points[7]; @@ -1498,8 +1498,8 @@ make_flat_labeled_edge(graph_t* g, spline_info_t* sp, path* P, edge_t* e, int et lb.LL.x = ND_coord(ln).x - ND_lw(ln); lb.UR.x = ND_coord(ln).x + ND_rw(ln); lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2; - ydelta = ND_coord(ln).y - GD_rank(g)[ND_rank(tn)].ht1 - - ND_coord(tn).y + GD_rank(g)[ND_rank(tn)].ht2; + double ydelta = ND_coord(ln).y - GD_rank(g)[ND_rank(tn)].ht1 - + ND_coord(tn).y + GD_rank(g)[ND_rank(tn)].ht2; ydelta /= 6; lb.LL.y = lb.UR.y - MAX(5,ydelta);