TransformGroupRectangles ( IGraph graph, LayoutContext originalLayoutContext, LayoutContext newLayoutContext ) { Debug.Assert(graph != null); Debug.Assert(originalLayoutContext != null); Debug.Assert(newLayoutContext != null); GroupLayoutDrawingInfo oGroupLayoutDrawingInfo; if (TryGetGroupLayoutDrawingInfo(graph, out oGroupLayoutDrawingInfo)) { // Replace the metadata value's group rectangles with a transformed // set of group rectangles. Matrix oTransformationMatrix = LayoutUtil.GetRectangleTransformation( originalLayoutContext.GraphRectangle, newLayoutContext.GraphRectangle ); foreach (GroupInfo oGroupInfo in oGroupLayoutDrawingInfo.GroupsToDraw) { oGroupInfo.Rectangle = LayoutUtil.TransformRectangle( oGroupInfo.Rectangle, oTransformationMatrix); } } }