Esempio n. 1
0
 //-----------------------------------------------------------------------------------------
 private bool view_centerOnSelection()
 {
     if (SelectedNode == null)
     {
         view_zoomFitAll();
     }
     else
     {
         PointF posCenter = posGraphToWin(SelectedNode.getCenter());
         float  x         = (float)(ClientRectangle.X + ClientRectangle.Width / 2);
         float  y         = (float)(ClientRectangle.Y + ClientRectangle.Height / 2);
         m_viewPos.X += x - posCenter.X;
         m_viewPos.Y += y - posCenter.Y;
         Refresh();
     }
     return(true);
 }