Skip to content

Commit

Permalink
More scrolling updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian William Wolter committed Sep 27, 2011
1 parent 085e67e commit 66de839
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions lib/UIKit/TUIScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -926,12 +926,14 @@ - (void)beginGestureWithEvent:(NSEvent *)event
- (void)_startThrow
{

if(fabsf(_lastScroll.dy) < 2.0 && fabsf(_lastScroll.dx) < 2.0){
return; // don't bother throwing
if(!self._pulling){
if(fabsf(_lastScroll.dy) < 2.0 && fabsf(_lastScroll.dx) < 2.0){
return; // don't bother throwing
}
}

if(!_throw.throwing) {
_throw.throwing = 1;
_throw.throwing = TRUE;

CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
CFTimeInterval dt = t - _lastScroll.t;
Expand All @@ -943,6 +945,29 @@ - (void)_startThrow

[self _startTimer:AnimationModeThrow];

if(_pull.xPulling) {
_pull.xPulling = NO;
if(signbit(_throw.vx) != signbit(_pull.x)) _throw.vx = 0.0;
[self _startBounce];
_bounce.x = _pull.x;
}

if(_pull.yPulling) {
_pull.yPulling = NO;
if(signbit(_throw.vy) != signbit(_pull.y)) _throw.vy = 0.0;
[self _startBounce];
_bounce.y = _pull.y;
}

if(self._pulling && _scrollViewFlags.didChangeContentInset){
_scrollViewFlags.didChangeContentInset = 0;
_bounce.x += _contentInset.left;
_bounce.y += _contentInset.top;
_unroundedContentOffset.x -= _contentInset.left;
_unroundedContentOffset.y -= _contentInset.top;
}

/*
if(self._pulling) {
_pull.xPulling = NO;
_pull.yPulling = NO;
Expand All @@ -966,7 +991,7 @@ - (void)_startThrow
}
}

*/
}

}
Expand Down

0 comments on commit 66de839

Please sign in to comment.