mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
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:
parent
e9b28c85c1
commit
2dc798da12
1 changed files with 11 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue