/// <summary> /// Invoke the pinching event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The pinch event.</param> internal void InvokePinching(View sender, PinchEvent e) { Pinching?.Invoke(sender, new PinchEventArgs(e)); if (e.State == GestureState.Ended && Command is ICommand cmd && cmd.CanExecute(CommandParameter)) { cmd.Execute(CommandParameter); } }
private void OnPinch(PointerInput input) { var pinchDistance = Vector2.Distance(_posLastFirst, _posLastSecond); var pinchInput = new PinchInput() { InputId = input.InputId, PinchDistance = pinchDistance, PinchDeltaDistance = pinchDistance - _pinchLastDistance, Pointer0CurrentPosition = _posLastFirst, Pointer0StartPosition = _pinchPosStartFirst, Pointer1CurrentPosition = _posLastSecond, Pointer1StartPosition = _pinchPosStartSecond }; //Debug.Log($"{nameof(GestureController)}: pinching: {pinchInput}"); Pinching?.Invoke(pinchInput); _pinchLastDistance = pinchDistance; }
public InteractiveCanvas() { Panning.Handle(OnPanning); Pinching.Handle(OnPinched); UserRotating.Handle(UserRotated); }