From 58c39c14a5987f06f656bd33c78dec8077b5ca53 Mon Sep 17 00:00:00 2001 From: Michael Bach Date: Tue, 16 Jul 2024 16:15:57 +0200 Subject: [PATCH] Update CPSlider.j (fixing bindings for case 'only stop at tick marks' This fixes bindings to also work when 'only stop at tick marks' is selected; formerly the code would crash silently with `setObjectValue`. --- AppKit/CPSlider.j | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppKit/CPSlider.j b/AppKit/CPSlider.j index b13d4d078..b7732c4dd 100644 --- a/AppKit/CPSlider.j +++ b/AppKit/CPSlider.j @@ -312,6 +312,9 @@ var AFFINITY = 5; if (!trackRect || CGRectIsEmpty(trackRect)) trackRect = bounds; + [self closestTickMarkValueToValue: [self doubleValue]]; // we only need the side effect … + _currentTickMarkSegment = _closestTickMarkIndex; // … when "Only stop on tick marks" selected + if (_isCircular) { var angle = 3 * PI_2 - (1.0 - [self doubleValue] - _minValue) / (_maxValue - _minValue) * PI2,