Pcbnew, exchange footprint and export DSN: fix incorrect rotation if the edit
option Flip was set to flip around Y axis. Fixes #4487 https://gitlab.com/kicad/code/kicad/issues/4487 Fixes #4478 https://gitlab.com/kicad/code/kicad/issues/4478
This commit is contained in:
parent
f4d7c323f5
commit
4efed4b729
|
@ -472,7 +472,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT&
|
|||
aDest->Flip( aDest->GetPosition(), m_Settings->m_FlipLeftRight );
|
||||
|
||||
if( aDest->GetOrientation() != aSrc->GetOrientation() )
|
||||
aDest->Rotate( aDest->GetPosition(), aSrc->GetOrientation() );
|
||||
aDest->SetOrientation( aSrc->GetOrientation() );
|
||||
|
||||
aDest->SetLocked( aSrc->IsLocked() );
|
||||
|
||||
|
|
|
@ -1729,12 +1729,16 @@ void SPECCTRA_DB::exportNETCLASS( const NETCLASSPTR& aNetClass, BOARD* aBoard )
|
|||
|
||||
void SPECCTRA_DB::FlipMODULEs( BOARD* aBoard )
|
||||
{
|
||||
// DSN Images (=KiCad MODULES and pads) must be presented from the
|
||||
// top view.
|
||||
// Note: to export footprints, the footprints must be flipped around the X axis,
|
||||
// otherwise the rotation angle is not good
|
||||
for( auto module : aBoard->Modules() )
|
||||
{
|
||||
module->SetFlag( 0 );
|
||||
if( module->GetLayer() == B_Cu )
|
||||
{
|
||||
module->Flip( module->GetPosition(), aBoard->GeneralSettings().m_FlipLeftRight );
|
||||
module->Flip( module->GetPosition(), false );
|
||||
module->SetFlag( 1 );
|
||||
}
|
||||
}
|
||||
|
@ -1750,11 +1754,12 @@ void SPECCTRA_DB::RevertMODULEs( BOARD* aBoard )
|
|||
|
||||
// DSN Images (=KiCad MODULES and pads) must be presented from the
|
||||
// top view. Restore those that were flipped.
|
||||
// Note: to export footprints, the footprints were flipped around the X axis,
|
||||
for( auto module : aBoard->Modules() )
|
||||
{
|
||||
if( module->GetFlag() )
|
||||
{
|
||||
module->Flip( module->GetPosition(), aBoard->GeneralSettings().m_FlipLeftRight );
|
||||
module->Flip( module->GetPosition(), false );
|
||||
module->SetFlag( 0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -377,8 +377,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard )
|
|||
if( module->GetLayer() != F_Cu )
|
||||
{
|
||||
// module is on copper layer (back)
|
||||
module->Flip( module->GetPosition(),
|
||||
aBoard->GeneralSettings().m_FlipLeftRight );
|
||||
module->Flip( module->GetPosition(), false );
|
||||
}
|
||||
|
||||
module->SetOrientation( orientation );
|
||||
|
@ -390,8 +389,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard )
|
|||
if( module->GetLayer() != B_Cu )
|
||||
{
|
||||
// module is on component layer (front)
|
||||
module->Flip( module->GetPosition(),
|
||||
aBoard->GeneralSettings().m_FlipLeftRight );
|
||||
module->Flip( module->GetPosition(), false );
|
||||
}
|
||||
|
||||
module->SetOrientation( orientation );
|
||||
|
|
Loading…
Reference in New Issue