示例#1
0
 public override void ToolActionCompleted()
 {
     if (_newPath != null)
     {
         _newPath.CloseFigure();
     }
     _startPathDraw = true;
     IsComplete     = true;
     _newPath       = null;
 }
示例#2
0
        /// <summary>
        /// Left nouse button is pressed
        /// </summary>
        /// <param name="drawArea"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(Xna2dDrawArea drawArea, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                ToolActionCompleted();
                return;
            }

            // Create new polygon, add it to the list
            // and keep reference to it
            if (_startPathDraw)
            {
                _newPath = new XnaDrawPath(e.X, e.Y);
                AddNewObject(drawArea, _newPath);
                _startPathDraw = false;
                IsComplete     = false;
            }
            else
            {
                Point loc = new Point(e.Location.X, e.Location.Y);
                _newPath.AddPoint(loc);
            }
        }