halkar / xamarin-range-slider

Range slider for Xamarin and Xamarin.Forms
https://www.nuget.org/packages/Xamarin.Forms.RangeSlider/
MIT License
89 stars 51 forks source link

StepValue missfunction #112

Closed lvbernal closed 6 years ago

lvbernal commented 6 years ago

Hi! I'm using Xamarin.Forms.RangeSlider on iOS, with the following properties:

MinimumValue = 869 MaximumValue = 894 StepValue = 5 LowerValue = 869 UpperValue = 894

It is expected that the slider moves between the values [869, 874, 879, 884, 889, 894], but the actual steps are [870, 875, 880, 885, 890, 894]. The latest -wrong- value would be 895, but it is not set because of the MaximumValue.

The StepValue is rounding the wrong way.

lvbernal commented 6 years ago

My workaround for this issue was to use 0-n integers in the slider, with StepSize=1, and then use the FormatLabel function to show the value I wanted. i.e. I mapped [869, 874, 879, 884, 889, 894] to [0, 1, 2, 3, 4, 5].

halkar commented 6 years ago

Fixed in 0.7.17