Esempio n. 1
0
        private void glControl1_MouseUp(object sender, MouseEventArgs e)
        {
            var mousePoint = new SKPoint(e.Location.X, e.Location.Y);

            if (plotEngagedWithMouse != null)
            {
                mouse.leftDown   = new SKPoint(0, 0);
                mouse.rightDown  = new SKPoint(0, 0);
                mouse.middleDown = new SKPoint(0, 0);
                LockTickDensity(false);

                if (e.Button == MouseButtons.Middle)
                {
                    plotEngagedWithMouse.AutoAxis();
                    Render();
                }
                plotEngagedWithMouse = null;
            }
        }
Esempio n. 2
0
        public void OnMouseClick(object sender, MouseEventArgs e)
        {
            SKPoint mouseLocation = new SKPoint(e.Location.X, e.Location.Y);

            if (e.Button == MouseButtons.Middle)
            {
                plotBeingClicked = fig.GetPlotUnderCursor(canvas, mouseLocation);
                if (plotBeingClicked != null)
                {
                    plotBeingClicked.mouse.LeftUp();
                    plotBeingClicked.mouse.RightUp();
                    if (e.Button == MouseButtons.Middle)
                    {
                        plotBeingClicked.AutoAxis();
                    }
                }
                plotBeingClicked = null;
                control.Refresh();
            }
        }
        private void UserControl_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var     position = e.GetPosition(this);
            SKPoint location = new SKPoint((int)(position.X * scaleFactor), (int)(position.Y * scaleFactor));

            if (plotEngagedWithMouse != null)
            {
                mouse.leftDown   = new SKPoint(0, 0);
                mouse.rightDown  = new SKPoint(0, 0);
                mouse.middleDown = new SKPoint(0, 0);
                LockTickDensity(false);

                if (e.ChangedButton == MouseButton.Middle)
                {
                    plotEngagedWithMouse.AutoAxis();
                    Render();
                }
                plotEngagedWithMouse = null;
            }
            ReleaseMouseCapture();
        }