diff --git a/ChangeLog b/ChangeLog index 18382d1de..5a6a92b40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-03 Riccardo Mottola + + * Source/NSSliderCell.m: + Circular sliders never return the maximum value, tested on Apple. + 2011-07-02 15:33-EDT Gregory John Casamento * Source/NSTableView.m: Modifications to initWithCoder: and diff --git a/Source/NSSliderCell.m b/Source/NSSliderCell.m index 8b37949b0..c56d99215 100644 --- a/Source/NSSliderCell.m +++ b/Source/NSSliderCell.m @@ -670,7 +670,7 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect, if (_numberOfTickMarks == 0) return aValue; - + effectiveTicks = _numberOfTickMarks; if (_type == NSCircularSlider) effectiveTicks++; @@ -691,6 +691,10 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect, f = ((aValue - _minValue) * (effectiveTicks - 1)) / d; f = ((rint(f) * d) / (effectiveTicks - 1)) + _minValue; + /* never return the maximum value, tested on Apple */ + if (_type == NSCircularSlider && (f >= _maxValue)) + f = _minValue; + return f; }