From 677d7b0a60ca35b27dd1aea1b4a0328d2e456148 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 7 Apr 2021 19:48:02 +0200 Subject: [PATCH] Eeschema, cross-probing: fix incorrect unit selection when highlight a pin. Highlight a pin of a multi-unit symbol from Pcbnew did not always select the right part. Fixes #8087 https://gitlab.com/kicad/code/kicad/issues/8087 --- eeschema/cross-probing.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 6d1fe9f9b9..c67f0a868d 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -75,8 +75,17 @@ SCH_ITEM* SCH_EDITOR_CONTROL::FindComponentAndItem( const wxString& aReference, pos = component->GetPosition(); // temporary: will be changed if the pin is found. pin = component->GetPin( aSearchText ); + // Ensure we have found the right unit in case of multi-units symbol if( pin ) { + int unit = pin->GetLibPin()->GetUnit(); + + if( unit != 0 && unit != component->GetUnit() ) + { + pin = nullptr; + continue; + } + // Get pin position in true schematic coordinate pos = pin->GetPosition(); foundItem = pin;