Small optimization - avoid to call the scrollview's _doScroll: on the first

click, if the click is not actually changing the float value


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15735 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2003-01-27 03:06:34 +00:00
parent e9b28c85c1
commit 2dc798da12

View file

@ -565,8 +565,11 @@ static NSColor *scrollBarColor = nil;
float floatValue = [self _floatValueForMousePoint:
[self convertPoint: location
fromView: nil]];
[self setFloatValue: floatValue];
[self sendAction: _action to: _target];
if (floatValue != _floatValue)
{
[self setFloatValue: floatValue];
[self sendAction: _action to: _target];
}
[self trackKnob: theEvent];
break;
}
@ -647,9 +650,12 @@ static NSColor *scrollBarColor = nil;
point = NSMakePoint(newPosition, newPosition);
floatValue = [self _floatValueForMousePoint: point];
[self setFloatValue: floatValue];
[self sendAction: _action to: _target];
if (floatValue != _floatValue)
{
[self setFloatValue: floatValue];
[self sendAction: _action to: _target];
}
lastPosition = newPosition;
}
}