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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
20 additions and
0 deletions
-
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) |
|
|
protected override void OnPointerMoved(PointerEventArgs e) |
|
|
{ |
|
|
{ |
|
|
if (_lastPoint.HasValue) |
|
|
if (_lastPoint.HasValue) |
|
|
|