From dfa16eda9510c67f135972c7210ec8f006ff89ea Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 31 Mar 2024 18:12:00 +0100 Subject: [PATCH] Fix copy/pasta in SHAPE_LINE_CHAIN::Collide(). Fixes https://gitlab.com/kicad/code/kicad/-/issues/17636 --- libs/kimath/src/geometry/shape_line_chain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/kimath/src/geometry/shape_line_chain.cpp b/libs/kimath/src/geometry/shape_line_chain.cpp index 819501b421..72501a0aa2 100644 --- a/libs/kimath/src/geometry/shape_line_chain.cpp +++ b/libs/kimath/src/geometry/shape_line_chain.cpp @@ -679,13 +679,13 @@ bool SHAPE_LINE_CHAIN::Collide( const SEG& aSeg, int aClearance, int* aActual, } } - if( closest_dist_sq == 0 || closest_dist_sq < clearance_sq ) + if( closest_dist == 0 || closest_dist < aClearance ) { if( aLocation ) *aLocation = nearest; if( aActual ) - *aActual = sqrt( closest_dist_sq ); + *aActual = closest_dist; return true; }