Don't insert pins/text when moving

Pins and component fields belong to the parent object and need to be
avoided when moving to prevent re-insertion on update.

Fixes #3804 | https://gitlab.com/kicad/code/kicad/issues/3804

Fixes #3811 | https://gitlab.com/kicad/code/kicad/issues/3811
This commit is contained in:
Seth Hillbrand 2020-01-25 09:23:28 -08:00
parent ceceb6c39d
commit 84a697060f
1 changed files with 18 additions and 1 deletions

View File

@ -442,7 +442,24 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
// Moving items changes the RTree box bounds.
for( auto item : selection )
m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( item ) );
{
switch( item->Type() )
{
// Moving sheet pins does not change the BBox.
case SCH_SHEET_PIN_T:
break;
// Moving fields should update the associated component
case SCH_FIELD_T:
if( item->GetParent() )
m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( item->GetParent() ) );
break;
default:
m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( item ) );
}
}
// If we move items away from a junction, we _may_ want to add a junction there
// to denote the state.