From 0391825504bef8781c20c6393f633bcd66b82d76 Mon Sep 17 00:00:00 2001 From: Stephan Troyer Date: Fri, 14 May 2021 21:52:07 +0200 Subject: [PATCH] don't limit movement by second thumb --- .../RangeSelector/RangeSelector.Input.Drag.cs | 4 ++-- .../RangeSelector/RangeSelector.Input.Pointer.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Drag.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Drag.cs index 9509d4df18d..c1aaf94a6b0 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Drag.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Drag.cs @@ -19,7 +19,7 @@ private void MinThumb_DragDelta(object sender, DragDeltaEventArgs e) { _absolutePosition += e.HorizontalChange; - RangeStart = DragThumb(_minThumb, 0, Canvas.GetLeft(_maxThumb), _absolutePosition); + RangeStart = DragThumb(_minThumb, 0, DragWidth(), _absolutePosition); if (_toolTipText != null) { @@ -31,7 +31,7 @@ private void MaxThumb_DragDelta(object sender, DragDeltaEventArgs e) { _absolutePosition += e.HorizontalChange; - RangeEnd = DragThumb(_maxThumb, Canvas.GetLeft(_minThumb), DragWidth(), _absolutePosition); + RangeEnd = DragThumb(_maxThumb, 0, DragWidth(), _absolutePosition); if (_toolTipText != null) { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Pointer.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Pointer.cs index 96add9a303c..ae31b360086 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Pointer.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Pointer.cs @@ -76,14 +76,14 @@ private void ContainerCanvas_PointerMoved(object sender, PointerRoutedEventArgs var position = e.GetCurrentPoint(_containerCanvas).Position.X; var normalizedPosition = ((position / DragWidth()) * (Maximum - Minimum)) + Minimum; - if (_pointerManipulatingMin && normalizedPosition < RangeEnd) + if (_pointerManipulatingMin) { - RangeStart = DragThumb(_minThumb, 0, Canvas.GetLeft(_maxThumb), position); + RangeStart = DragThumb(_minThumb, 0, DragWidth(), position); UpdateToolTipText(this, _toolTipText, RangeStart); } - else if (_pointerManipulatingMax && normalizedPosition > RangeStart) + else if (_pointerManipulatingMax) { - RangeEnd = DragThumb(_maxThumb, Canvas.GetLeft(_minThumb), DragWidth(), position); + RangeEnd = DragThumb(_maxThumb, 0, DragWidth(), position); UpdateToolTipText(this, _toolTipText, RangeEnd); } }