Snap to pads when placing via
Fixes https://gitlab.com/kicad/code/kicad/issues/9873
This commit is contained in:
parent
95087c6de5
commit
04b0435c45
|
@ -2555,6 +2555,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
|||
PCB_VIA* via = static_cast<PCB_VIA*>( aItem );
|
||||
wxPoint position = via->GetPosition();
|
||||
PCB_TRACK* track = findTrack( via );
|
||||
PAD* pad = findPad( via );
|
||||
|
||||
if( track )
|
||||
{
|
||||
|
@ -2563,6 +2564,12 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
|||
|
||||
aItem->SetPosition( (wxPoint) snap );
|
||||
}
|
||||
else if( pad && m_gridHelper.GetSnap()
|
||||
&& m_frame->GetMagneticItemsSettings()->pads
|
||||
== MAGNETIC_OPTIONS::CAPTURE_ALWAYS )
|
||||
{
|
||||
aItem->SetPosition( pad->GetPosition() );
|
||||
}
|
||||
}
|
||||
|
||||
bool PlaceItem( BOARD_ITEM* aItem, BOARD_COMMIT& aCommit ) override
|
||||
|
|
Loading…
Reference in New Issue