Skip to content

Commit 618d89d

Browse files
Illustar0Avid29
authored andcommitted
docs: add comments explaining vertical drag logic
Clarify why DragThumb uses different parameters in vertical orientation. Explain that MaxThumb has a lower U coordinate than MinThumb vertically, affecting the valid range calculation. Co-authored-by: Avishai Dernis <Avid29@Live.com>
1 parent 8138f47 commit 618d89d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

components/RangeSelector/src/RangeSelector.Input.Drag.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ private void MaxThumb_DragDelta(object sender, DragDeltaEventArgs e)
2929
{
3030
var uvChange = new UVCoord(e.HorizontalChange, e.VerticalChange, Orientation);
3131
_absolutePosition += uvChange.U;
32-
32+
// Adjust the position of the max thumb and update RangeEnd.
33+
// Note that max thumb has a lower U coordinate than min in vertical orientation,
34+
// so the valid range changes from between [0, minThumbPos] to [minThumbPos, DragWidth()]
3335
var minThumbPos = GetCanvasPos(_minThumb).U;
3436
RangeEnd = Orientation == Orientation.Horizontal
3537
? DragThumb(_maxThumb, minThumbPos, DragWidth(), _absolutePosition)

0 commit comments

Comments
 (0)