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.
This commit is contained in:
jean-pierre charras 2020-04-08 11:06:41 +02:00
parent cb7263d017
commit 6e593aa1e0
1 changed files with 2 additions and 1 deletions

View File

@ -368,8 +368,9 @@ void SCH_BASE_FRAME::FocusOnItem( SCH_ITEM* aItem )
{
SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( 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();
}