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:
Jeff Young
2025-03-10 13:34:01 +00:00
parent c4655da4e6
commit 6ac64d290b
3 changed files with 16 additions and 6 deletions
+6 -1
View File
@@ -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;