private void Form1_MouseMove(object sender, MouseEventArgs e) { if (mouseDown) { if (shape != null) { float dx = e.X - shape.X; float dy = e.Y - shape.Y; shape.Move(dx, dy); // Invalidate(); } } Invalidate(); }
private void Form1_MouseMove(object sender, MouseEventArgs e) { if (mouseDown) { if (selectedShape != null) { float dx = e.X - prevX; float dy = e.Y - prevY; selectedShape.Move(dx, dy); Invalidate(); } prevX = e.X; prevY = e.Y; } }