From 0e6df5b2e5c6ced47f82be9d3c737f703bd252bd Mon Sep 17 00:00:00 2001 From: Sasha Reid Date: Tue, 16 Feb 2016 14:20:28 +1100 Subject: [PATCH] Fixed bug when setting lower and upper bounds in a specific order I've added a quick if-statement to detect if the lower bounds will be less than _minimumValue as a result of setting lowerValue before upperValue. --- NMRangeSlider/NMRangeSlider.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NMRangeSlider/NMRangeSlider.m b/NMRangeSlider/NMRangeSlider.m index b320cf1..476bba3 100755 --- a/NMRangeSlider/NMRangeSlider.m +++ b/NMRangeSlider/NMRangeSlider.m @@ -136,7 +136,9 @@ - (void) setLowerValue:(float)lowerValue value = MIN(value, _lowerMaximumValue); } - value = MIN(value, _upperValue - _minimumRange); + if (MIN(value, _upperValue - _minimumRange) >= _minimumValue) { + value = MIN(value, _upperValue - _minimumRange); + } _lowerValue = value;