Exemplo n.º 1
0
        public bool MouseMoveEvent(MouseEventArgs e)
        {
            switch (Operation)
            {
            case 2:
            {
                SelectedItem.ResizeShape(e.X - MousePosition.X, e.Y - MousePosition.Y, ResizeRotateNumber);
                MousePosition = new Point(e.X, e.Y);
                return(true);
            }

            case 3:
            {
                if ((MousePosition.Y - e.Y) != 0)
                {
                    float angle = (float)RotateAngle(new Point((int)MousePosition.X, (int)MousePosition.Y), new Point(e.X, e.Y), new Point(SelectedItem.GetBounds().Location.X + SelectedItem.GetBounds().Size.Width / 2, SelectedItem.GetBounds().Location.Y + SelectedItem.GetBounds().Size.Height / 2));

                    SelectedItem.RotateShape(new Point(SelectedItem.GetBounds().Location.X + SelectedItem.GetBounds().Size.Width / 2, SelectedItem.GetBounds().Location.Y + SelectedItem.GetBounds().Size.Height / 2), angle);

                    MousePosition = new Point(e.X, e.Y);
                }
                return(true);
            }
            }
            return(false);
        }
Exemplo n.º 2
0
        public void Draw(Graphics g)
        {
            bool isActive = false;

            if (SelectedItem != null)
            {
                isActive = true;
            }

            if (SelectedItem != null)
            {
                ResizeRotate = new ResizeRotateHandler(SelectedItem.GetBounds().Size, SelectedItem.GetBounds().Location);
                ResizeRotate.Draw(g, isActive);
            }



            if (isActive == false)
            {
                ResizeRotate = null;
            }
        }