* Source/GSGuiPrivate.h: New rounding rounding function

GSRoundTowardsInfinity which is simply floor(x+0.5)
* Source/NSBrowser.m:
* Source/NSSliderCell.m:
* Source/NSButtonCell.m:
* Source/NSClipView.m:
* Source/NSOutlineView.m:
* Source/NSRulerView.m:
Switch rint[f] to GSRoundTowardsInfinity


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33539 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2011-07-12 21:12:22 +00:00
parent adca33937f
commit c7e05f2c7b
8 changed files with 45 additions and 19 deletions

View file

@ -44,7 +44,8 @@
#import "AppKit/NSWindow.h"
#import <GNUstepGUI/GSTheme.h>
DEFINE_RINT_IF_MISSING
#import "GSGuiPrivate.h"
#ifndef HAVE_ATAN2F
#define atan2f atan2
#endif
@ -689,7 +690,7 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect,
d = _maxValue - _minValue;
f = ((aValue - _minValue) * (effectiveTicks - 1)) / d;
f = ((rint(f) * d) / (effectiveTicks - 1)) + _minValue;
f = ((GSRoundTowardsInfinity(f) * d) / (effectiveTicks - 1)) + _minValue;
/* never return the maximum value, tested on Apple */
if (_type == NSCircularSlider && (f >= _maxValue))