eeschema: Only allow dragging of draggable items
When expanding the drag item to allow corners, we accidentally picked up other items in the list. This limits the items that can be dragged to only those that are explicitly in the draggable list. A side effect of this commit is that when converting from move to drag (with tab), items not in the draggable list will be left in place. Fixes: lp:1787966 * https://bugs.launchpad.net/kicad/+bug/1787966
This commit is contained in:
parent
7012226284
commit
1f60d8fdbf
|
@ -893,7 +893,8 @@ int SCH_SCREEN::UpdatePickList()
|
|||
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
||||
{
|
||||
// An item is picked if its bounding box intersects the reference area.
|
||||
if( item->HitTest( area ) )
|
||||
if( item->HitTest( area ) &&
|
||||
( !m_BlockLocate.IsDragging() || item->IsType( SCH_COLLECTOR::DraggableItems ) ) )
|
||||
{
|
||||
picker.SetItem( item );
|
||||
m_BlockLocate.PushItem( picker );
|
||||
|
|
|
@ -265,6 +265,23 @@ public:
|
|||
void ClearFlags( STATUS_FLAGS aMask = EDA_ITEM_ALL_FLAGS ) { m_Flags &= ~aMask; }
|
||||
STATUS_FLAGS GetFlags() const { return m_Flags; }
|
||||
|
||||
/**
|
||||
* Function IsType
|
||||
* Checks whether the item is one of the listed types
|
||||
* @param aScanTypes List of item types
|
||||
* @return true if the item type is contained in the list aScanTypes
|
||||
*/
|
||||
bool IsType( const KICAD_T aScanTypes[] )
|
||||
{
|
||||
for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
|
||||
{
|
||||
if( m_StructType == *p )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetForceVisible
|
||||
* is used to set and cleag force visible flag used to force the item to be drawn
|
||||
|
|
Loading…
Reference in New Issue