diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index b8f71b3df5..7f56617894 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -41,7 +41,7 @@ #include #include #include - +#include #include #include #include @@ -382,6 +382,14 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( GetBoard()->m_Modules ) { SaveFootprintInLibrary( GetCurrentLib(), GetBoard()->m_Modules ); + + m_toolManager->GetView()->Update( GetBoard()->m_Modules ); + + if( IsGalCanvasActive() && GetGalCanvas() ) + GetGalCanvas()->ForceRefresh(); + else + GetCanvas()->Refresh(); + GetScreen()->ClrModify(); } break; diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 79a687f606..156503f0aa 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -701,6 +701,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary( wxString activeLibrary, MODUL wxString libraryName = aModule->GetFPID().GetLibNickname(); wxString footprintName = aModule->GetFPID().GetLibItemName(); + bool updateValue = ( aModule->GetValue() == footprintName ); if( libraryName.IsEmpty() ) libraryName = activeLibrary; @@ -776,6 +777,9 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary( wxString activeLibrary, MODUL aModule->SetFPID( LIB_ID( libraryName, footprintName ) ); + if( updateValue ) + aModule->SetValue( footprintName ); + // Legacy libraries are readable, but modifying legacy format is not allowed // So prompt the user if he try to add/replace a footprint in a legacy lib wxString libfullname = Prj().PcbFootprintLibs()->FindRow( libraryName )->GetFullURI();