From d2cf2fe61c57d80e3c32e4c9b337ace33617cf38 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 16 Apr 2018 10:39:34 +0200 Subject: [PATCH] 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 --- eeschema/sheet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 720f0a8bec..4e22416e87 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -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 );