oli107 / material-range-bar

Android widget for selecting a range of values.
Apache License 2.0
1.68k stars 370 forks source link

Fix an issue with the right pin being moved on a click to the left of equal pins #125

Closed mdpearce closed 6 years ago

mdpearce commented 6 years ago

Currently on the range bar, if the pins are both set to the same value and the user clicks on the bar to the left of the pins, the right pin would move to the click position instead of the left. This means that the right pin is actually to the left of the left pin.

This PR addresses the issue by performing an additional check for equality between the 2 pins while calculating the distance.

krazykira commented 6 years ago

@mdpearce Merged. Thankyou for your contribution