From 0370db43aeafa392c4dc8505487d1d1b5c757ad3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 4 Feb 2024 23:16:43 +0000 Subject: [PATCH] A footprint does it's own child hit testing. We only need to add it for groups. --- pcbnew/tools/pcb_selection_tool.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index d3ba808fa0..4d7196bd78 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2982,12 +2982,15 @@ bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const bool found = false; - static_cast( item )->RunOnDescendants( - [&]( BOARD_ITEM* aItem ) - { - if( aItem->HitTest( aPoint, margin ) ) - found = true; - } ); + if( PCB_GROUP* group = dynamic_cast( item ) ) + { + group->RunOnDescendants( + [&]( BOARD_ITEM* aItem ) + { + if( aItem->HitTest( aPoint, margin ) ) + found = true; + } ); + } if( found ) return true;