Global pad edition:Custom Pad Shapes incorrectly exported (push command)

Fixes: lp:1748043
https://bugs.launchpad.net/kicad/+bug/1748043
This commit is contained in:
jean-pierre charras 2018-02-08 09:24:38 +01:00
parent 826efab999
commit be70ce7d4a
1 changed files with 14 additions and 40 deletions

View File

@ -194,6 +194,10 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
if( aPadLayerFilter && pad->GetLayerSet() != aPad->GetLayerSet() ) if( aPadLayerFilter && pad->GetLayerSet() != aPad->GetLayerSet() )
continue; continue;
// Do not copy a pad into it, it can create issue, and this is useless
if( pad == aPad )
continue;
saveMe = true; saveMe = true;
} }
@ -231,7 +235,8 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) ) if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
continue; continue;
if( aPadOrientFilter && (pad->GetOrientation() - module->GetOrientation()) != pad_orient ) if( aPadOrientFilter &&
(pad->GetOrientation() - module->GetOrientation()) != pad_orient )
continue; continue;
if( aPadLayerFilter ) if( aPadLayerFilter )
@ -240,49 +245,18 @@ void PCB_BASE_FRAME::GlobalChange_PadSettings( D_PAD* aPad,
continue; continue;
} }
// Change characteristics: // Do not copy a pad into it, it can create issue in custom pads
pad->SetAttribute( aPad->GetAttribute() ); // and primitive list.
pad->SetShape( aPad->GetShape() ); if( pad == aPad )
continue;
pad->SetLayerSet( aPad->GetLayerSet() ); // Copy physical characteristics:
pad->ImportSettingsFromMaster( *aPad );
pad->SetSize( aPad->GetSize() ); // copy also local mask margins:
pad->SetDelta( aPad->GetDelta() );
pad->SetOffset( aPad->GetOffset() );
pad->SetDrillSize( aPad->GetDrillSize() );
pad->SetDrillShape( aPad->GetDrillShape() );
pad->SetOrientation( pad_orient + module->GetOrientation() );
// copy also local mask margins, because these parameters usually depend on
// pad sizes and layers
pad->SetLocalSolderMaskMargin( aPad->GetLocalSolderMaskMargin() ); pad->SetLocalSolderMaskMargin( aPad->GetLocalSolderMaskMargin() );
pad->SetLocalSolderPasteMargin( aPad->GetLocalSolderPasteMargin() ); pad->SetLocalSolderPasteMargin( aPad->GetLocalSolderPasteMargin() );
pad->SetLocalSolderPasteMarginRatio( aPad->GetLocalSolderPasteMarginRatio() ); pad->SetLocalSolderPasteMarginRatio( aPad->GetLocalSolderPasteMarginRatio() );
if( pad->GetShape() != PAD_SHAPE_TRAPEZOID )
{
pad->SetDelta( wxSize( 0, 0 ) );
}
if( pad->GetShape() == PAD_SHAPE_CIRCLE )
{
// Ensure pad size.y = pad size.x
int size = pad->GetSize().x;
pad->SetSize( wxSize( size, size ) );
}
switch( pad->GetAttribute() )
{
case PAD_ATTRIB_SMD:
case PAD_ATTRIB_CONN:
pad->SetDrillSize( wxSize( 0, 0 ) );
break;
default:
break;
}
} }
module->CalculateBoundingBox(); module->CalculateBoundingBox();