Skip to content

Commit

Permalink
Merge pull request #4031 from stephtr/rangeselector-continuous
Browse files Browse the repository at this point in the history
RangeSelector: Moving past second handle
  • Loading branch information
michael-hawker authored Sep 14, 2021
2 parents 07687af + a620d99 commit 03c3f3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 03c3f3c

Please sign in to comment.