Browse Source

Refinement for fix in 5497.

pull/2/head
Maciej Suminski 11 years ago
parent
commit
035b231b62
  1. 4
      pcbnew/pcbframe.cpp
  2. 9
      pcbnew/tools/selection_tool.cpp

4
pcbnew/pcbframe.cpp

@ -467,6 +467,8 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
bool new_board = ( aBoard != m_Pcb );
PCB_BASE_FRAME::SetBoard( aBoard );
if( IsGalCanvasActive() )
@ -484,6 +486,8 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
m_toolManager->SetEnvironment( aBoard, drawPanel->GetView(),
drawPanel->GetViewControls(), this );
if( new_board )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
}
}

9
pcbnew/tools/selection_tool.cpp

@ -88,6 +88,15 @@ SELECTION_TOOL::~SELECTION_TOOL()
void SELECTION_TOOL::Reset( RESET_REASON aReason )
{
if( aReason == TOOL_BASE::MODEL_RELOAD )
{
// Remove pointers to the selected items from containers
// without changing their properties (as they are already deleted
// while a new board is loaded)
m_selection.group->Clear();
m_selection.clear();
}
else
// Restore previous properties of selected items and remove them from containers
clearSelection();

Loading…
Cancel
Save