Better handling of PCB_BITMAP items in a footprint.
- Ensure they can be erased in the FP editor - Ensure they cannot be selected in the PCB editor (they are not show) Fixes #13714 https://gitlab.com/kicad/code/kicad/issues/
This commit is contained in:
parent
8aa225bd1e
commit
f8051d954a
|
@ -641,6 +641,7 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode )
|
|||
case PCB_FP_DIM_LEADER_T:
|
||||
case PCB_FP_SHAPE_T:
|
||||
case PCB_FP_TEXTBOX_T:
|
||||
case PCB_BITMAP_T:
|
||||
for( auto it = m_drawings.begin(); it != m_drawings.end(); ++it )
|
||||
{
|
||||
if( *it == aBoardItem )
|
||||
|
|
|
@ -66,6 +66,7 @@ using namespace std::placeholders;
|
|||
#include <dialogs/dialog_unit_entry.h>
|
||||
#include <board_commit.h>
|
||||
#include <zone_filler.h>
|
||||
#include <pcb_bitmap.h>
|
||||
|
||||
const unsigned int EDIT_TOOL::COORDS_PADDING = pcbIUScale.mmToIU( 20 );
|
||||
|
||||
|
@ -1864,6 +1865,21 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
|
|||
break;
|
||||
}
|
||||
|
||||
case PCB_BITMAP_T:
|
||||
if( IsFootprintEditor() )
|
||||
{
|
||||
PCB_BITMAP* fp_bitmap = static_cast<PCB_BITMAP*>( item );
|
||||
FOOTPRINT* parent = static_cast<FOOTPRINT*>( item->GetParent() );
|
||||
|
||||
m_commit->Modify( parent );
|
||||
getView()->Remove( fp_bitmap );
|
||||
parent->Remove( fp_bitmap );
|
||||
}
|
||||
else
|
||||
m_commit->Remove( item );
|
||||
|
||||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
if( IsFootprintEditor() || frame()->GetPcbNewSettings()->m_AllowFreePads )
|
||||
{
|
||||
|
|
|
@ -2240,12 +2240,17 @@ bool PCB_SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem, bool aMultiSelect
|
|||
case PCB_FP_SHAPE_T:
|
||||
case PCB_SHAPE_T:
|
||||
case PCB_TARGET_T:
|
||||
case PCB_BITMAP_T:
|
||||
if( !m_filter.graphics )
|
||||
return false;
|
||||
|
||||
break;
|
||||
|
||||
case PCB_BITMAP_T:
|
||||
if( !m_filter.graphics || !m_isFootprintEditor )
|
||||
return false;
|
||||
|
||||
break;
|
||||
|
||||
case PCB_FP_TEXT_T:
|
||||
case PCB_FP_TEXTBOX_T:
|
||||
case PCB_TEXT_T:
|
||||
|
|
Loading…
Reference in New Issue