I have setup a diagram using the Sugiyama Layout. I have added 50 Rounded Rectangle shapes (without connectors) in code behind. I am using the following code to size the shapes to fit the diagram:
Rect allShapesBounds = Diagram1.Shapes.GetEnclosingBounds(); Rect inflatedRect = allShapesBounds.InflateRect(10, 10, 10, 10); Diagram1.BringIntoView(inflatedRect, false);
- Allow the moved shape to fit in without over lapping
- Adjust to fill the empty spot
In the attached image Before.png you will see the 50 shapes all sized and lined up correctly. The After.png shows I moved the shape with the #1 is overlapping the others and there is a space where it used to reside. I tried calling the above code in the drag event handler but that returns the moved shape to it's original position. What do I need to do to achieve the results listed above?