Use parent's transform when moving SCH_FIELDs.
Fixes: lp:1827873 * https://bugs.launchpad.net/kicad/+bug/1827873
This commit is contained in:
parent
b97d65e791
commit
a76bcc204f
|
@ -539,7 +539,7 @@ void SCH_FIELD::SetPosition( const wxPoint& aPosition )
|
|||
wxPoint pos = ( (SCH_COMPONENT*) GetParent() )->GetPosition();
|
||||
|
||||
// Actual positions are calculated by the rotation/mirror transform of the
|
||||
// parent component of the field. The inverse transfrom is used to calculate
|
||||
// parent component of the field. The inverse transform is used to calculate
|
||||
// the position relative to the parent component.
|
||||
wxPoint pt = aPosition - pos;
|
||||
|
||||
|
|
|
@ -579,9 +579,14 @@ void SCH_MOVE_TOOL::moveItem( EDA_ITEM* aItem, VECTOR2I aDelta, bool isDrag )
|
|||
|
||||
case SCH_PIN_T:
|
||||
case SCH_FIELD_T:
|
||||
static_cast<SCH_ITEM*>( aItem )->Move( wxPoint( aDelta.x, -aDelta.y ) );
|
||||
break;
|
||||
{
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) aItem->GetParent();
|
||||
TRANSFORM transform = component->GetTransform().InverseTransform();
|
||||
wxPoint transformedDelta = transform.TransformCoordinate( (wxPoint) aDelta );
|
||||
|
||||
static_cast<SCH_ITEM*>( aItem )->Move( transformedDelta );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
static_cast<SCH_ITEM*>( aItem )->Move( (wxPoint) aDelta );
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue