Eeschema: fix a selection bug created in commit bec87864.

Apparently the schematic and symbol library editors now have common
selection filtering so checking for a valid LIB_EDIT_FRAME when
filtering for the  schematic editor frame prevented all schematic
object from being selected.
This commit is contained in:
Wayne Stambaugh 2019-12-12 11:42:11 -05:00
parent bec878640c
commit a18d7a8495
1 changed files with 15 additions and 11 deletions

View File

@ -1085,8 +1085,6 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
// NOTE: in the future this is where eeschema layer/itemtype visibility will be handled
LIB_EDIT_FRAME* editFrame = dynamic_cast< LIB_EDIT_FRAME* >( m_frame );
wxCHECK( editFrame, false );
switch( aItem->Type() )
{
case SCH_PIN_T:
@ -1098,12 +1096,15 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
return false;
case LIB_FIELD_T:
{
if( editFrame )
{
LIB_PART* currentPart = editFrame->GetCurPart();
// Nothing in derived symbols is editable at the moment.
if( currentPart && currentPart->IsAlias() )
return false;
}
break;
}
@ -1115,6 +1116,8 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
case LIB_POLYLINE_T:
case LIB_BEZIER_T:
case LIB_PIN_T:
{
if( editFrame )
{
LIB_ITEM* lib_item = (LIB_ITEM*) aItem;
@ -1123,6 +1126,7 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
if( lib_item->GetConvert() && lib_item->GetConvert() != editFrame->GetConvert() )
return false;
}
break;
}