Keep pin positions stable when resizing sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/6196
This commit is contained in:
parent
bddc97df30
commit
92d6988f10
|
@ -572,6 +572,10 @@ void EE_POINT_EDITOR::updateParentItem() const
|
|||
pinEditedCorner( getEditedPointIndex(), sheet->GetMinWidth(), sheet->GetMinHeight(),
|
||||
topLeft, topRight, botLeft, botRight, grid_size );
|
||||
|
||||
// Pin positions are relative to origin. Attempt to leave them where they
|
||||
// are if the origin moves.
|
||||
wxPoint originDelta = sheet->GetPosition() - (wxPoint) topLeft;
|
||||
|
||||
sheet->SetPosition( (wxPoint) topLeft );
|
||||
sheet->SetSize( wxSize( botRight.x - topLeft.x, botRight.y - topLeft.y ) );
|
||||
|
||||
|
@ -584,6 +588,8 @@ void EE_POINT_EDITOR::updateParentItem() const
|
|||
{
|
||||
wxPoint pos = pin->GetPosition();
|
||||
|
||||
pos += originDelta;
|
||||
|
||||
switch( pin->GetEdge() )
|
||||
{
|
||||
case SHEET_LEFT_SIDE: pos.x = topLeft.x; break;
|
||||
|
|
Loading…
Reference in New Issue