Пример #1
0
        // RECTANGLE HANDLE //////////////////////////////////////////////////////////////////////////////////////////////////
        private void FormMain_MouseUp_BuildRectangle(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            if (BuildType != ObstacleType.Rectangle)
            {
                return;
            }

            LeftMouseIsHolding = false;
            Obstacle NewObstacle = new Obstacle_Rectangle(LeftMouseDownPos, MousePos, IsBuildingMirrors);

            Obstacles.Add(NewObstacle);
        }
Пример #2
0
        private void FormMain_Paint_BuildRectangle(object sender, PaintEventArgs e)
        {
            if (!LeftMouseIsHolding)
            {
                return;
            }
            if (BuildType != ObstacleType.Rectangle)
            {
                return;
            }

            Graphics g = e.Graphics;
            Pen      p = new Pen(Color.LightPink, 5f);
            Obstacle o = new Obstacle_Rectangle(LeftMouseDownPos, MousePos, IsBuildingMirrors);

            o.Show(g, p);
        }