diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 3abe8f08ad..933339b3e3 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -59,6 +60,8 @@ #include #include +#include + // Functions defined in block_module_editor, but used here // These 2 functions are used in modedit to rotate or mirror the whole footprint @@ -452,15 +455,31 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) pcbframe->SetCrossHairPosition( wxPoint( 0, 0 ) ); pcbframe->PlaceModule( newmodule, NULL ); + newmodule->SetPosition( wxPoint( 0, 0 ) ); pcbframe->SetCrossHairPosition( cursor_pos ); newmodule->SetTimeStamp( GetNewTimeStamp() ); pcbframe->SaveCopyInUndoList( newmodule, UR_NEW ); + + if( IsGalCanvasActive() ) + { + KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView(); + + newmodule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + view->Add( newmodule ); + } } newmodule->ClearFlags(); GetScreen()->ClrModify(); pcbframe->SetCurItem( NULL ); mainpcb->m_Status_Pcb = 0; + + if( IsGalCanvasActive() ) + { + RN_DATA* ratsnest = pcbframe->GetBoard()->GetRatsnest(); + ratsnest->Update( newmodule ); + ratsnest->Recalculate(); + } } break;