From 2bb54404cd198db111c83af746d0f253670334cf Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 6 Mar 2022 15:03:38 -0800 Subject: [PATCH] common round_corners: rephrase some open coded 'hypot' --- lib/common/shapes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.50.1