Eeschema, fix issue when rotating a hierarchical sheet: depending on the sheet size, the rotation center was not always on grid.

Therefore, in this case, pin sheets were no longer on grid.

Fixes: lp:1764270
https://bugs.launchpad.net/kicad/+bug/1764270
This commit is contained in:
jean-pierre charras 2018-04-16 10:39:34 +02:00
parent 8fcdc4f6c3
commit d2cf2fe61c
1 changed files with 4 additions and 0 deletions

View File

@ -491,6 +491,10 @@ void SCH_EDIT_FRAME::RotateHierarchicalSheet( SCH_SHEET* aSheet, bool aRotCCW )
// Rotation is made around it center
wxPoint rotPoint = aSheet->GetBoundingBox().Centre();
// Keep this rotation point on the grid, otherwise all items of this sheet
// will be moved off grid
rotPoint = GetNearestGridPosition( rotPoint );
// rotate CCW, or CW. to rotate CW, rotate 3 times
aSheet->Rotate( rotPoint );