Tidy up pad & parent footprint selection corner cases.
Fixes https://gitlab.com/kicad/code/kicad/issues/9923
(cherry picked from commit d9dba2edb2
)
This commit is contained in:
parent
34d855cd53
commit
1dc78c4adc
|
@ -699,6 +699,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
|
||||||
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
||||||
{
|
{
|
||||||
sTool->FilterCollectorForMarkers( aCollector );
|
sTool->FilterCollectorForMarkers( aCollector );
|
||||||
|
sTool->FilterCollectorForHierarchy( aCollector, true );
|
||||||
},
|
},
|
||||||
// Prompt user regarding locked items if in board editor and in free-pad-mode (if
|
// Prompt user regarding locked items if in board editor and in free-pad-mode (if
|
||||||
// we're not in free-pad mode we delay this until the second RequestSelection()).
|
// we're not in free-pad mode we delay this until the second RequestSelection()).
|
||||||
|
@ -720,6 +721,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
|
||||||
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
||||||
{
|
{
|
||||||
sTool->FilterCollectorForMarkers( aCollector );
|
sTool->FilterCollectorForMarkers( aCollector );
|
||||||
|
sTool->FilterCollectorForHierarchy( aCollector, true );
|
||||||
sTool->FilterCollectorForFreePads( aCollector );
|
sTool->FilterCollectorForFreePads( aCollector );
|
||||||
},
|
},
|
||||||
true /* prompt user regarding locked items */ );
|
true /* prompt user regarding locked items */ );
|
||||||
|
@ -1068,6 +1070,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
||||||
|
|
||||||
editFrame->PopTool( tool );
|
editFrame->PopTool( tool );
|
||||||
|
editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||||
|
|
||||||
return restore_state ? -1 : 0;
|
return restore_state ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
@ -1419,6 +1422,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
|
||||||
PCB_SELECTION& selection = m_selectionTool->RequestSelection(
|
PCB_SELECTION& selection = m_selectionTool->RequestSelection(
|
||||||
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
||||||
{
|
{
|
||||||
|
sTool->FilterCollectorForHierarchy( aCollector, true );
|
||||||
sTool->FilterCollectorForMarkers( aCollector );
|
sTool->FilterCollectorForMarkers( aCollector );
|
||||||
},
|
},
|
||||||
// Prompt user regarding locked items if in board editor and in free-pad-mode (if
|
// Prompt user regarding locked items if in board editor and in free-pad-mode (if
|
||||||
|
|
|
@ -551,25 +551,19 @@ PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCl
|
||||||
DISPOSITION disposition = itemDisposition.second;
|
DISPOSITION disposition = itemDisposition.second;
|
||||||
|
|
||||||
if( disposition == BEFORE )
|
if( disposition == BEFORE )
|
||||||
{
|
|
||||||
unhighlight( item, SELECTED, &m_selection );
|
unhighlight( item, SELECTED, &m_selection );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for( std::pair<EDA_ITEM* const, DISPOSITION> itemDisposition : itemDispositions )
|
for( std::pair<EDA_ITEM* const, DISPOSITION> itemDisposition : itemDispositions )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( itemDisposition.first );
|
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( itemDisposition.first );
|
||||||
DISPOSITION disposition = itemDisposition.second;
|
DISPOSITION disposition = itemDisposition.second;
|
||||||
|
|
||||||
if( disposition == AFTER )
|
// Note that we must re-highlight even previously-highlighted items
|
||||||
{
|
// (ie: disposition BOTH) in case we removed any of their children.
|
||||||
|
if( disposition == AFTER || disposition == BOTH )
|
||||||
highlight( item, SELECTED, &m_selection );
|
highlight( item, SELECTED, &m_selection );
|
||||||
}
|
}
|
||||||
else if( disposition == BOTH )
|
|
||||||
{
|
|
||||||
// nothing to do
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_frame->GetCanvas()->ForceRefresh();
|
m_frame->GetCanvas()->ForceRefresh();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue