GetClampedCoords: Better usability for rounding

This commit is contained in:
Alex 2021-12-09 22:10:03 +03:00 committed by Seth Hillbrand
parent 4d7d367b25
commit b81a3f0533
1 changed files with 2 additions and 5 deletions

View File

@ -263,12 +263,9 @@ VECTOR2I PCB_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& a
int snapDist = snapRange;
//Respect limits of coordinates representation
VECTOR2D origin = GetClampedCoords( VECTOR2D( aOrigin ) - snapRange / 2 );
VECTOR2D end = GetClampedCoords( VECTOR2D( aOrigin ) + snapRange / 2 );
BOX2I bb;
bb.SetOrigin( KiROUND( origin.x ), KiROUND( origin.y ) );
bb.SetEnd( KiROUND( end.x ), KiROUND( end.y ) );
bb.SetOrigin( GetClampedCoords<double, int>( VECTOR2D( aOrigin ) - snapRange / 2 ) );
bb.SetEnd( GetClampedCoords<double, int>( VECTOR2D( aOrigin ) + snapRange / 2 ) );
clearAnchors();