public void HandleWithTouch(Touch touch) { var position = touch.GetPosition(0); if (StartArea.Contains(position) && touch.GetState(0) == State.Pressing) { StartDragPosition = position; } else if (StartDragPosition != Vector2D.Unused && touch.GetState(0) != State.Released) { InvokeIfMovedFarEnough(position); } else { StartDragPosition = Vector2D.Unused; } }
public void HandleWithMouse(Mouse mouse) { if (StartArea.Contains(mouse.Position) && mouse.GetButtonState(Button) == State.Pressing) { StartDragPosition = mouse.Position; } else if (StartDragPosition != Vector2D.Unused && mouse.GetButtonState(Button) != State.Released) { if (StartDragPosition.DistanceTo(mouse.Position) > PositionEpsilon) { Invoke(); } else { StartDragPosition = Vector2D.Unused; } } }