From: Emden Gansner Date: Mon, 21 May 2012 15:20:31 +0000 (-0400) Subject: Fix new arrow code to compile on Windows X-Git-Tag: LAST_LIBGRAPH~32^2~413^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa1c8540127a4aefd32f69f743ed6cdde7275ebd;p=graphviz Fix new arrow code to compile on Windows --- diff --git a/lib/common/arrows.c b/lib/common/arrows.c index ddad793d3..097b6763b 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -610,10 +610,18 @@ static void arrow_type_dot(GVJ_t * job, pointf p, pointf u, double arrowsize, do */ static void arrow_type_curve(GVJ_t* job, pointf p, pointf u, double arrowsize, double penwidth, int flag) { - double const arrowwidth = penwidth > 4 ? 0.5 * penwidth / 4 : 0.5; - pointf const q = {p.x + u.x, p.y + u.y}, v = {-u.y * arrowwidth, u.x * arrowwidth}, - w = {v.y, -v.x}; // same direction as u, same magnitude as v. - pointf AF[4], a[2] = {p, q}; + double arrowwidth = penwidth > 4 ? 0.5 * penwidth / 4 : 0.5; + pointf q, v, w; + pointf AF[4], a[2]; + + q.x = p.x + u.x; + q.y = p.y + u.y; + v.x = -u.y * arrowwidth; + v.y = u.x * arrowwidth; + w.x = v.y; // same direction as u, same magnitude as v. + w.y = -v.x; + a[0] = p; + a[1] = q; AF[0].x = p.x + v.x + w.x; AF[0].y = p.y + v.y + w.y;