From b81a3f05339d87b1627ef12ef98ad0956015b6b7 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Dec 2021 22:10:03 +0300 Subject: [PATCH] GetClampedCoords: Better usability for rounding --- pcbnew/tools/pcb_grid_helper.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index bdc7605841..d0fd0b2e96 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -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( VECTOR2D( aOrigin ) - snapRange / 2 ) ); + bb.SetEnd( GetClampedCoords( VECTOR2D( aOrigin ) + snapRange / 2 ) ); clearAnchors();