public void CenterRect( Rect bounds, Action afterwards )
Parameters
- bounds
- a
Rectin model coordinates - afterwards
- an
Actionto be performed after the animation is finished; may be null
Rect in model coordinates
Action to be performed after the animation is finished; may be null
public void CenterRect( Rect bounds, Action afterwards )
Rect in model coordinatesAction to be performed after the animation is finished; may be nullThe HorizontalContentAlignment and VerticalContentAlignment properties need to be "Stretch" if the DiagramBounds are smaller than the viewport. But in any case, the bounds might not be centered if the panel cannot be scrolled far enough.
If you want to try to center the selection in the viewport, call: myDiagram.Panel.CenterRect(myDiagram.Panel.ComputeBounds(myDiagram.SelectedParts), null);