Exemplo n.º 1
0
        public override void OnMouseUp(MouseEventArgs mouseEvent)
        {
            if (!LockTrackBall && TrackBallController.CurrentTrackingType != TrackBallController.MouseDownType.None)
            {
                if (TrackBallController.CurrentTrackingType == TrackBallController.MouseDownType.Rotation &&
                    TrackBallController.LastMoveInsideRadius)
                {
                    // try and preserve some of the velocity
                    motionQueue.AddMoveToMotionQueue(mouseEvent.Position, UiThread.CurrentTimerMs);

                    currentVelocityPerMs = motionQueue.GetVelocityPixelsPerMs();
                    if (currentVelocityPerMs.LengthSquared > 0)
                    {
                        UiThread.RunOnIdle(ApplyVelocity);
                    }
                }

                TrackBallController.OnMouseUp();
            }

            base.OnMouseUp(mouseEvent);
        }
Exemplo n.º 2
0
        public override void OnMouseUp(MouseEventArgs mouseEvent)
        {
            if (!LockTrackBall && TrackBallController.CurrentTrackingType != TrackBallTransformType.None)
            {
                if (TrackBallController.CurrentTrackingType == TrackBallTransformType.Rotation)
                {
                    // try and preserve some of the velocity
                    motionQueue.AddMoveToMotionQueue(mouseEvent.Position, UiThread.CurrentTimerMs);

                    if (!Keyboard.IsKeyDown(Keys.ShiftKey))
                    {
                        currentVelocityPerMs = motionQueue.GetVelocityPixelsPerMs();
                        if (currentVelocityPerMs.LengthSquared > 0)
                        {
                            runningInterval = UiThread.SetInterval(ApplyVelocity, 1.0 / updatesPerSecond);
                        }
                    }
                }

                TrackBallController.OnMouseUp();
            }

            base.OnMouseUp(mouseEvent);
        }