halkar / xamarin-range-slider

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

[IOS] Throw Exception when MinimumValue and MaximumValue are equals #87

Closed LuisM000 closed 7 years ago

LuisM000 commented 7 years ago

Hi. I have a problem in IOS (Xamarin forms) when I set the minimum and maximum values equal. For example: <forms: RangeSlider MinimumValue = "1" MaximumValue = "1" /> Throws an exception. Reviewing the code, the problem is in the Xamarin.RangeSlider.IOS project, in the TrackRect() function of the RangeSliderControl class (NaN values ..). Any solution?

Thank you. Greetings,

Luis

halkar commented 7 years ago

@LuisM000 unless you really need to don't set MinimumValue and MaximumValue to the same value. Bug is legit and I'll fix it but I see no reason to use same value for max and min.
<forms:RangeSlider MinimumValue = "1" MaximumValue = "4" LowerValue="2" UpperValue="3"/>

LuisM000 commented 7 years ago

Thanks @halkar, it will be useful to me :)

halkar commented 7 years ago

fixed 0.7.7

LuisM000 commented 6 years ago

Can you solve it in 0.6.XX (0.6.19) version in NuGet? Thank you. Greetings,

Luis

halkar commented 6 years ago

@LuisM000 no. Why do you need 0.6.x?

LuisM000 commented 6 years ago

@halkar currently, by project requirements, I can not upgrade Xamarin.RangeSlider to 0.7.x version, I must remain in 0.6.x version. Sorry :(

Greetings, Luis

halkar commented 6 years ago

@LuisM000 then you will have to make sure that max and min value are always different (even smallest epsilon will do).