From bd585192b341594e1875fca2d22c4bb99b4fb9d8 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 24 Dec 2024 02:06:59 +0400 Subject: [PATCH] Fix slider --- .../LegacyComponents/Sources/TGPhotoEditorSliderView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m b/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m index b7c8e59536..e32c11cdb5 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m @@ -381,7 +381,11 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f; - (void)setValue:(CGFloat)value animated:(BOOL)__unused animated { - _value = MIN(MAX(_lowerBoundValue, MAX(value, _minimumValue)), _maximumValue); + if (_lowerBoundValue > FLT_EPSILON) { + _value = MIN(MAX(_lowerBoundValue, MAX(value, _minimumValue)), _maximumValue); + } else { + _value = MIN(MAX(value, _minimumValue), _maximumValue); + } [self setNeedsLayout]; }