From: Matthew Fernandez Date: Sun, 6 Mar 2022 23:03:38 +0000 (-0800) Subject: common round_corners: rephrase some open coded 'hypot' X-Git-Tag: 4.0.0~185^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bb54404cd198db111c83af746d0f253670334cf;p=graphviz common round_corners: rephrase some open coded 'hypot' --- diff --git a/lib/common/shapes.c b/lib/common/shapes.c index c46441c93..b28810f97 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -562,7 +563,7 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled) p1 = AF[0]; dx = p1.x - p0.x; dy = p1.y - p0.y; - d = sqrt(dx * dx + dy * dy); + d = hypot(dx, dy); rbconst = MIN(rbconst, d / 3.0); } for (seg = 0; seg < sides; seg++) { @@ -573,7 +574,7 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled) p1 = AF[0]; dx = p1.x - p0.x; dy = p1.y - p0.y; - d = sqrt(dx * dx + dy * dy); + d = hypot(dx, dy); t = rbconst / d; if (shape == BOX3D || shape == COMPONENT) t /= 3;