Skip to content

Commit 03c3f3c

Browse files
Merge pull request #4031 from stephtr/rangeselector-continuous
RangeSelector: Moving past second handle
2 parents 07687af + a620d99 commit 03c3f3c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Drag.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private void MinThumb_DragDelta(object sender, DragDeltaEventArgs e)
1919
{
2020
_absolutePosition += e.HorizontalChange;
2121

22-
RangeStart = DragThumb(_minThumb, 0, Canvas.GetLeft(_maxThumb), _absolutePosition);
22+
RangeStart = DragThumb(_minThumb, 0, DragWidth(), _absolutePosition);
2323

2424
if (_toolTipText != null)
2525
{
@@ -31,7 +31,7 @@ private void MaxThumb_DragDelta(object sender, DragDeltaEventArgs e)
3131
{
3232
_absolutePosition += e.HorizontalChange;
3333

34-
RangeEnd = DragThumb(_maxThumb, Canvas.GetLeft(_minThumb), DragWidth(), _absolutePosition);
34+
RangeEnd = DragThumb(_maxThumb, 0, DragWidth(), _absolutePosition);
3535

3636
if (_toolTipText != null)
3737
{

Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector/RangeSelector.Input.Pointer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ private void ContainerCanvas_PointerMoved(object sender, PointerRoutedEventArgs
7676
var position = e.GetCurrentPoint(_containerCanvas).Position.X;
7777
var normalizedPosition = ((position / DragWidth()) * (Maximum - Minimum)) + Minimum;
7878

79-
if (_pointerManipulatingMin && normalizedPosition < RangeEnd)
79+
if (_pointerManipulatingMin)
8080
{
81-
RangeStart = DragThumb(_minThumb, 0, Canvas.GetLeft(_maxThumb), position);
81+
RangeStart = DragThumb(_minThumb, 0, DragWidth(), position);
8282
UpdateToolTipText(this, _toolTipText, RangeStart);
8383
}
84-
else if (_pointerManipulatingMax && normalizedPosition > RangeStart)
84+
else if (_pointerManipulatingMax)
8585
{
86-
RangeEnd = DragThumb(_maxThumb, Canvas.GetLeft(_minThumb), DragWidth(), position);
86+
RangeEnd = DragThumb(_maxThumb, 0, DragWidth(), position);
8787
UpdateToolTipText(this, _toolTipText, RangeEnd);
8888
}
8989
}

0 commit comments

Comments
 (0)