From 2278f4005159b23dcec2eaad3c9d981f4bd922ab Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 9 Sep 2019 23:16:29 +0100 Subject: [PATCH] Fix zero failure in SEG::PointCloserThan(). Fixes: lp:1843329 * https://bugs.launchpad.net/kicad/+bug/1843329 --- common/geometry/seg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/geometry/seg.cpp b/common/geometry/seg.cpp index a0f8a56405..ec8e980337 100644 --- a/common/geometry/seg.cpp +++ b/common/geometry/seg.cpp @@ -40,9 +40,9 @@ bool SEG::PointCloserThan( const VECTOR2I& aP, int aDist ) const SEG::ecoord t = d.Dot( aP - A ); if( t <= 0 || !l_squared ) - return ( aP - A ).SquaredEuclideanNorm() < dist_sq; + return ( aP - A ).SquaredEuclideanNorm() <= dist_sq; else if( t >= l_squared ) - return ( aP - B ).SquaredEuclideanNorm() < dist_sq; + return ( aP - B ).SquaredEuclideanNorm() <= dist_sq; int dxdy = abs( d.x ) - abs( d.y );