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.
This commit is contained in:
Seth Hillbrand 2020-06-12 15:00:28 -07:00
parent a8ab668122
commit 4d4d24fc61
1 changed files with 1 additions and 2 deletions

View File

@ -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, VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x,
KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y ); KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y );
auto line = aArc.ConvertToPolyline();
int min_d = std::numeric_limits<int>::max(); int min_d = std::numeric_limits<int>::max();
for( auto pt : line.CPoints() ) for( auto pt : { aArc.GetP0(), aArc.GetP1() } )
{ {
int d = ( pt - aPoint ).EuclideanNorm(); int d = ( pt - aPoint ).EuclideanNorm();