GRID_HELPER: Remove double-check condition

We only need to check nearest once.
This commit is contained in:
Seth Hillbrand 2018-10-06 23:21:55 -07:00
parent 8189fbe85c
commit e1fe3c7ed4
1 changed files with 1 additions and 1 deletions

View File

@ -289,7 +289,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLaye
{ {
double snapDist = nearest->Distance( aOrigin ); double snapDist = nearest->Distance( aOrigin );
if( nearest && ( !m_enableGrid || snapDist <= gridDist ) ) if( !m_enableGrid || snapDist <= gridDist )
{ {
m_viewSnapPoint.SetPosition( nearest->pos ); m_viewSnapPoint.SetPosition( nearest->pos );
m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true ); m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true );