|
|
|
@ -115,26 +115,17 @@ namespace Avalonia.Input |
|
|
|
KeyModifiers inputModifiers, IInputElement? hitTest, |
|
|
|
Lazy<IReadOnlyList<RawPointerPoint>?>? intermediatePoints) |
|
|
|
{ |
|
|
|
if (pointer.CapturedGestureRecognizer is GestureRecognizer gestureRecognizer) |
|
|
|
{ |
|
|
|
if (gestureRecognizer.Target != null) |
|
|
|
{ |
|
|
|
var e = new PointerEventArgs(InputElement.PointerMovedEvent, gestureRecognizer.Target, pointer, (Visual)root, |
|
|
|
p, timestamp, properties, inputModifiers, intermediatePoints); |
|
|
|
gestureRecognizer.PointerMoved(e); |
|
|
|
|
|
|
|
return e.Handled; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var source = pointer.Captured ?? hitTest; |
|
|
|
var source = pointer.CapturedGestureRecognizer?.Target ?? pointer.Captured ?? hitTest; |
|
|
|
|
|
|
|
if (source is not null) |
|
|
|
{ |
|
|
|
var e = new PointerEventArgs(InputElement.PointerMovedEvent, source, pointer, (Visual)root, |
|
|
|
p, timestamp, properties, inputModifiers, intermediatePoints); |
|
|
|
|
|
|
|
source.RaiseEvent(e); |
|
|
|
if (pointer.CapturedGestureRecognizer is GestureRecognizer gestureRecognizer) |
|
|
|
gestureRecognizer.PointerMovedInternal(e); |
|
|
|
else |
|
|
|
source.RaiseEvent(e); |
|
|
|
return e.Handled; |
|
|
|
} |
|
|
|
|
|
|
|
@ -145,26 +136,17 @@ namespace Avalonia.Input |
|
|
|
IInputElement root, Point p, PointerPointProperties properties, |
|
|
|
KeyModifiers inputModifiers, IInputElement? hitTest) |
|
|
|
{ |
|
|
|
if (pointer.CapturedGestureRecognizer is GestureRecognizer gestureRecognizer) |
|
|
|
{ |
|
|
|
if (gestureRecognizer.Target != null) |
|
|
|
{ |
|
|
|
var e = new PointerReleasedEventArgs(gestureRecognizer.Target, pointer, (Visual)root, p, timestamp, properties, inputModifiers, |
|
|
|
_lastMouseDownButton); |
|
|
|
gestureRecognizer.PointerReleased(e); |
|
|
|
|
|
|
|
return e.Handled; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var source = pointer.Captured ?? hitTest; |
|
|
|
var source = pointer.CapturedGestureRecognizer?.Target ?? pointer.Captured ?? hitTest; |
|
|
|
|
|
|
|
if (source is not null) |
|
|
|
{ |
|
|
|
var e = new PointerReleasedEventArgs(source, pointer, (Visual)root, p, timestamp, properties, inputModifiers, |
|
|
|
_lastMouseDownButton); |
|
|
|
|
|
|
|
source.RaiseEvent(e); |
|
|
|
if (pointer.CapturedGestureRecognizer is GestureRecognizer gestureRecognizer) |
|
|
|
gestureRecognizer.PointerReleasedInternal(e); |
|
|
|
else |
|
|
|
source.RaiseEvent(e); |
|
|
|
pointer.Capture(null); |
|
|
|
pointer.CaptureGestureRecognizer(null); |
|
|
|
_lastMouseDownButton = default; |
|
|
|
|