Esempio n. 1
0
        private void fitButton_Click(object sender, RoutedEventArgs e)
        {
            Rect union = Rect.Empty;

            foreach (DiagramNode node in DD.Nodes)
            {
                if (union.IsEmpty)
                {
                    union = node.Bounds;
                }
                else
                {
                    union.Union(node.Bounds);
                }
            }

            union.Inflate(50, 50);

            DD.ZoomToRect(union);
        }
Esempio n. 2
0
        public void FitSize()
        {
            Rect union = Rect.Empty;

            foreach (DiagramNode node in DD.Nodes)
            {
                if (union.IsEmpty)
                {
                    union = node.Bounds;
                }
                else
                {
                    union.Union(node.Bounds);
                }
            }

            union.Inflate(50, 50);

            DD.ZoomToRect(union);
        }