Browse Source

Merge pull request #6244 from megazyz/fixes/6243-thumb-mousecaptureloss

Fix: Thumb should handle pointer capture loss
pull/6251/head
Dariusz Komosiński 5 years ago
committed by GitHub
parent
commit
572a67dc8a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/Avalonia.Controls/Primitives/Thumb.cs

20
src/Avalonia.Controls/Primitives/Thumb.cs

@ -56,6 +56,26 @@ namespace Avalonia.Controls.Primitives
{
}
protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)
{
if (_lastPoint.HasValue)
{
var ev = new VectorEventArgs
{
RoutedEvent = DragCompletedEvent,
Vector = _lastPoint.Value,
};
_lastPoint = null;
RaiseEvent(ev);
}
PseudoClasses.Remove(":pressed");
base.OnPointerCaptureLost(e);
}
protected override void OnPointerMoved(PointerEventArgs e)
{
if (_lastPoint.HasValue)

Loading…
Cancel
Save