Browse Source

Keep symbol synced with edit tool

Undo/Redo can change the symbol referenced by the symbol drawing tool.
This updates the current symbol before important steps to keep the
system synced

Fixes https://gitlab.com/kicad/code/kicad/issues/10125

(cherry picked from commit b8a7a66a0a)
7.0
Seth Hillbrand 4 years ago
parent
commit
88a8ad2ca1
  1. 2
      eeschema/symbol_editor/symbol_editor.cpp
  2. 9
      eeschema/tools/symbol_editor_drawing_tools.cpp

2
eeschema/symbol_editor/symbol_editor.cpp

@ -385,6 +385,8 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
ClearUndoRedoList();
// Display the document information based on the entry selected just in
// case the entry is an alias.
UpdateMsgPanel();

9
eeschema/tools/symbol_editor_drawing_tools.cpp

@ -343,6 +343,9 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_LEFT ) && !item )
{
// Update in case the symbol was changed while the tool was running
symbol = m_frame->GetCurSymbol();
if( !symbol )
continue;
@ -365,6 +368,12 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
else if( item && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT )
|| evt->IsAction( &EE_ACTIONS::finishDrawing ) ) )
{
if( symbol != m_frame->GetCurSymbol() )
{
symbol = m_frame->GetCurSymbol();
item->SetParent( symbol );
}
if( evt->IsDblClick( BUT_LEFT ) || evt->IsAction( &EE_ACTIONS::finishDrawing )
|| !item->ContinueEdit( wxPoint( cursorPos.x, -cursorPos.y ) ) )
{

Loading…
Cancel
Save