From 6e593aa1e0cf5770842dba59203c1a6432142725 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 8 Apr 2020 11:06:41 +0200 Subject: [PATCH] SCH_BASE_FRAME::FocusOnItem() fix incorrect calculation of a pin physical position. Only ERC dialog was affected: when clicking on a error item, if the item is a pin the cursor was put far from the right location. --- eeschema/sch_base_frame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 9dde917a04..cf193c23b6 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -368,8 +368,9 @@ void SCH_BASE_FRAME::FocusOnItem( SCH_ITEM* aItem ) { SCH_COMPONENT* comp = static_cast( aItem->GetParent() ); + // for a pin, GetPosition() is relative to the symbol, not rotated, not mirrored + // calculate the physical position: wxPoint delta; - position -= comp->GetPosition(); delta = comp->GetTransform().TransformCoordinate( position ); position = delta + comp->GetPosition(); }