Check parent footprint as well for component class.
Also output more descriptive text when checking inherited rules on parent footprint. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20281
This commit is contained in:
@@ -1263,7 +1263,12 @@ static void hasComponentClassFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
||||
result->SetDeferredEval(
|
||||
[item, arg]() -> double
|
||||
{
|
||||
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( item );
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
|
||||
if( item->Type() == PCB_FOOTPRINT_T )
|
||||
footprint = static_cast<FOOTPRINT*>( item );
|
||||
else
|
||||
footprint = item->GetParentFootprint();
|
||||
|
||||
if( !footprint )
|
||||
return 0.0;
|
||||
|
||||
Reference in New Issue
Block a user