Beispiel #1
0
        private void DragController(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (!IsDragged)
                {
                    RaiseDraggingStarted(e);
                }

                paintable.Focus();

                IsDragged = true;

                var moveAmount = new Size(e.X - LatchPoint.X, e.Y - LatchPoint.Y);
                if (IsDragValid(moveAmount))
                {
                    paintable.Location += moveAmount;
                }
                LatchPoint = e.Location;
                paintable.Parent.Invalidate();
            }
        }
Beispiel #2
0
 public void ClickedOnPaintable(MouseEventArgs a, IPaintable paintable)
 {
     paintable.Focus();
     ClickedUsingTool?.Invoke(this, new PaintMouseArgs(a, paintable));
 }