mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Sync selection & selection flags after replacing fields.
This commit is contained in:
parent
1f620e9cca
commit
0a3f14c855
@ -46,6 +46,8 @@
|
|||||||
#include <panel_fp_properties_3d_model.h>
|
#include <panel_fp_properties_3d_model.h>
|
||||||
#include <dialogs/panel_preview_3d_model.h>
|
#include <dialogs/panel_preview_3d_model.h>
|
||||||
#include <dialog_footprint_properties.h>
|
#include <dialog_footprint_properties.h>
|
||||||
|
#include <tool/tool_manager.h>
|
||||||
|
#include <tools/pcb_selection_tool.h>
|
||||||
|
|
||||||
|
|
||||||
int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page during session
|
int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page during session
|
||||||
@ -501,6 +503,8 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow()
|
|||||||
if( !m_itemsGrid->CommitPendingChanges() )
|
if( !m_itemsGrid->CommitPendingChanges() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
KIGFX::PCB_VIEW* view = m_frame->GetCanvas()->GetView();
|
||||||
|
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
|
||||||
BOARD_COMMIT commit( m_frame );
|
BOARD_COMMIT commit( m_frame );
|
||||||
commit.Modify( m_footprint );
|
commit.Modify( m_footprint );
|
||||||
|
|
||||||
@ -555,6 +559,15 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow()
|
|||||||
newField->SetOrdinal( ordinal++ );
|
newField->SetOrdinal( ordinal++ );
|
||||||
|
|
||||||
m_footprint->Add( newField );
|
m_footprint->Add( newField );
|
||||||
|
view->Add( newField );
|
||||||
|
|
||||||
|
if( newField->IsSelected() )
|
||||||
|
{
|
||||||
|
// The old copy was in the selection list, but this one is not. Remove the
|
||||||
|
// out-of-sync selection flag so we can re-add the field to the selection.
|
||||||
|
newField->ClearSelected();
|
||||||
|
selectionTool->AddItemToSel( newField, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize masks clearances
|
// Initialize masks clearances
|
||||||
|
@ -531,6 +531,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
KIGFX::PCB_VIEW* view = m_frame->GetCanvas()->GetView();
|
KIGFX::PCB_VIEW* view = m_frame->GetCanvas()->GetView();
|
||||||
|
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
|
||||||
BOARD_COMMIT commit( m_frame );
|
BOARD_COMMIT commit( m_frame );
|
||||||
commit.Modify( m_footprint );
|
commit.Modify( m_footprint );
|
||||||
|
|
||||||
@ -589,6 +590,14 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow()
|
|||||||
PCB_FIELD* newField = field.CloneField();
|
PCB_FIELD* newField = field.CloneField();
|
||||||
m_footprint->Add( newField );
|
m_footprint->Add( newField );
|
||||||
view->Add( newField );
|
view->Add( newField );
|
||||||
|
|
||||||
|
if( newField->IsSelected() )
|
||||||
|
{
|
||||||
|
// The old copy was in the selection list, but this one is not. Remove the
|
||||||
|
// out-of-sync selection flag so we can re-add the field to the selection.
|
||||||
|
newField->ClearSelected();
|
||||||
|
selectionTool->AddItemToSel( newField, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LSET privateLayers;
|
LSET privateLayers;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user