GRID_HELPER: Update target geometry when moving

Setting a previously visible item visible is a nop.  If the target was
visible, make sure to update the geometry

Fixes: lp:1802405
* https://bugs.launchpad.net/kicad/+bug/1802405
This commit is contained in:
Seth Hillbrand 2018-11-09 06:11:44 -08:00
parent f1f4473d8b
commit 70e660dfe8
1 changed files with 6 additions and 1 deletions

View File

@ -292,7 +292,12 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLaye
if( !m_enableGrid || snapDist <= gridDist )
{
m_viewSnapPoint.SetPosition( nearest->pos );
m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true );
if( m_frame->GetGalCanvas()->GetView()->IsVisible( &m_viewSnapPoint ) )
m_frame->GetGalCanvas()->GetView()->Update( &m_viewSnapPoint, KIGFX::GEOMETRY);
else
m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true );
return nearest->pos;
}
}