private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (plotEngagedWithMouse != null) { plotEngagedWithMouse.MouseUp(upLocation: e.Location); if (e.Button == MouseButtons.Middle) { plotEngagedWithMouse.AutoAxis(); Render(); } plotEngagedWithMouse = null; } }
private void UserControl_MouseUp(object sender, MouseButtonEventArgs e) { var position = e.GetPosition(this); System.Drawing.Point location = new System.Drawing.Point((int)(position.X * scaleFactor), (int)(position.Y * scaleFactor)); if (plotEngagedWithMouse != null) { plotEngagedWithMouse.MouseUp(upLocation: location); if (e.ChangedButton == MouseButton.Middle) { plotEngagedWithMouse.AutoAxis(); Render(); } plotEngagedWithMouse = null; } ReleaseMouseCapture(); }