Ejemplo n.º 1
0
        private void PictureBoxPaint_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (settings.Mode != EFigure.Dot && settings.Mode != EFigure.Move)
                {
                    mouseHandler.NewMove(e.Location);
                }
                if (settings.Mode != EFigure.Move)
                {
                    if (!_isFigureCreated)
                    {
                        _isFigureCreated = true;
                        drawingEngine.DrawNewFigure();
                    }
                    else
                    {
                        drawingEngine.RedrawNewFigure();
                    }
                }

                PictureBoxPaint.Image = drawingEngine.MainImage;

                if (settings.Mode == EFigure.Move)
                {
                    mouseHandler.NewMove(e.Location);
                    drawingEngine.MoveFigure();
                    PictureBoxPaint.Image = drawingEngine.MainImage;
                }
            }
            else if (settings.Mode == EFigure.SmoothCurve && !_isLineFinished)
            {
                mouseHandler.NewMove(e.Location);
                if (!_isFigureCreated)
                {
                    _isFigureCreated = true;
                    drawingEngine.DrawNewFigure();
                }
                else
                {
                    drawingEngine.ClearAllExceptMainImage();
                    drawingEngine.RedrawNewFigure();
                }
                PictureBoxPaint.Image = drawingEngine.MainImage;
            }
        }
Ejemplo n.º 2
0
 public void MoveFigureTest1MouseHandler()
 {
     _mousehandler.Setup(a => a.GetPreviousMove()).Returns(new System.Drawing.Point());
     _drawingEngine.MoveFigure();
     _mousehandler.Verify(a => a.GetPreviousMove(), Times.Never);
 }