public void AddEndPoint(Shape shape, Point point)
        {
            if (point == null)
            {
                return;
            }
            if (shape == null)
            {
                return;
            }

            Point oldTopLeft      = new Point(Canvas.GetLeft(shape), Canvas.GetTop(shape));
            Point newtopLeftPoint = PlaneAlgorithms.CalculateTopLeftPoint(oldTopLeft, point);

            Canvas.SetLeft(shape, newtopLeftPoint.X);
            Canvas.SetTop(shape, newtopLeftPoint.Y);
            shape.Height = PlaneAlgorithms.YDistance(oldTopLeft, point);
            shape.Width  = PlaneAlgorithms.XDistance(oldTopLeft, point);
        }
Beispiel #2
0
 internal void SetHeightWidthOfShape()
 {
     selectedShape.TwoDShape.Height = PlaneAlgorithms.YDistance(InitialPoint, EndPoint);
     selectedShape.TwoDShape.Width  = PlaneAlgorithms.XDistance(InitialPoint, EndPoint);
 }