Esempio n. 1
0
        internal void ResizeShape()
        {
            Point topLeftPoint = PlaneAlgorithms.CalculateTopLeftPoint(InitialPoint, EndPoint);

            SetTopLeftPoint(selectedShape.TwoDShape, topLeftPoint);
            SetHeightWidthOfShape();
        }
        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);
        }