// // Self mouse move // protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (_pressingContainer) { if (_layerPressPoint.Distance(e.Location) > 20) { _draggingLayer = true; Invalidate(); } } if (_draggingLayer) { if (e.Location.Y < -pb_layerImage.Location.Y - 5) { LayerControlDragged?.Invoke(this, new LayerControlDragEventArgs(LayerDragDirection.Up)); } else if (e.Location.Y - pb_layerImage.Location.Y > Height + 5) { LayerControlDragged?.Invoke(this, new LayerControlDragEventArgs(LayerDragDirection.Down)); } } }
// // Layer Image picture box mouse move // private void pb_layerImage_MouseMove(object sender, MouseEventArgs e) { if (!_pressingLayer) { return; } if (_layerPressPoint.Distance(e.Location) > 20) { _draggingLayer = true; Invalidate(); } if (_draggingLayer) { if (e.Location.Y < -pb_layerImage.Location.Y - 5) { LayerControlDragged?.Invoke(this, new LayerControlDragEventArgs(LayerDragDirection.Up)); } else if (e.Location.Y - pb_layerImage.Location.Y > Height + 5) { LayerControlDragged?.Invoke(this, new LayerControlDragEventArgs(LayerDragDirection.Down)); } } }