|
|
|
@ -4,7 +4,6 @@ using Avalonia.Controls.Automation.Peers; |
|
|
|
using Avalonia.Controls.Metadata; |
|
|
|
using Avalonia.Input; |
|
|
|
using Avalonia.Interactivity; |
|
|
|
using Avalonia.VisualTree; |
|
|
|
|
|
|
|
namespace Avalonia.Controls.Primitives |
|
|
|
{ |
|
|
|
@ -85,22 +84,20 @@ namespace Avalonia.Controls.Primitives |
|
|
|
{ |
|
|
|
if (_lastPoint.HasValue) |
|
|
|
{ |
|
|
|
var point = e.GetPosition(null); |
|
|
|
var ev = new VectorEventArgs |
|
|
|
{ |
|
|
|
RoutedEvent = DragDeltaEvent, |
|
|
|
Vector = point - _lastPoint.Value, |
|
|
|
Vector = e.GetPosition(this) - _lastPoint.Value, |
|
|
|
}; |
|
|
|
|
|
|
|
RaiseEvent(ev); |
|
|
|
_lastPoint = point; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnPointerPressed(PointerPressedEventArgs e) |
|
|
|
{ |
|
|
|
e.Handled = true; |
|
|
|
_lastPoint = e.GetPosition(null); |
|
|
|
_lastPoint = e.GetPosition(this); |
|
|
|
|
|
|
|
var ev = new VectorEventArgs |
|
|
|
{ |
|
|
|
@ -123,7 +120,7 @@ namespace Avalonia.Controls.Primitives |
|
|
|
var ev = new VectorEventArgs |
|
|
|
{ |
|
|
|
RoutedEvent = DragCompletedEvent, |
|
|
|
Vector = (Vector)e.GetPosition(null), |
|
|
|
Vector = (Vector)e.GetPosition(this), |
|
|
|
}; |
|
|
|
|
|
|
|
RaiseEvent(ev); |
|
|
|
|