From 4d4d24fc617c697c4417c7c4a60dbd12de7e511b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 12 Jun 2020 15:00:28 -0700 Subject: [PATCH] Don't snap to arc midpoints This removes the extra snap points in the arcs, ensuring the endpoint snaps connect to the correct location on an arc. --- pcbnew/tools/grid_helper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pcbnew/tools/grid_helper.cpp b/pcbnew/tools/grid_helper.cpp index 15d006d35f..3427b5683d 100644 --- a/pcbnew/tools/grid_helper.cpp +++ b/pcbnew/tools/grid_helper.cpp @@ -190,10 +190,9 @@ VECTOR2I GRID_HELPER::AlignToArc( const VECTOR2I& aPoint, const SHAPE_ARC& aArc VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x, KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y ); - auto line = aArc.ConvertToPolyline(); int min_d = std::numeric_limits::max(); - for( auto pt : line.CPoints() ) + for( auto pt : { aArc.GetP0(), aArc.GetP1() } ) { int d = ( pt - aPoint ).EuclideanNorm();