Skip to content

Commit

Permalink
Fixed a display bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbsGen committed Feb 25, 2016
1 parent fd116e5 commit 03b51e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SlimeRefresh/SlimeRefresh/SRRefreshView.m
Expand Up @@ -236,12 +236,12 @@ - (void)scroll {
l = MIN(distansBetween(_slime.startPoint, _slime.toPoint), l);
CGPoint ssp = _slime.startPoint;
_slime.toPoint = CGPointMake(ssp.x, ssp.y - l);
CGFloat pf = (1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo;
CGFloat pf = MIN(MAX((1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo, 0), 1);
_refleshView.layer.transform = CATransform3DMakeScale(pf, pf, 1);
}else if (self.scrollView.isDragging) {
CGPoint ssp = _slime.startPoint;
_slime.toPoint = CGPointMake(ssp.x, ssp.y - l);
CGFloat pf = (1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo;
CGFloat pf = MIN(MAX((1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo, 0), 1);
_refleshView.layer.transform = CATransform3DMakeScale(pf, pf, 1);
}
_oldLength = l;
Expand All @@ -263,8 +263,12 @@ - (void)scrollViewDidScroll
[_slime setNeedsDisplay];
if (_slimeMissWhenGoingBack) self.alpha = -(p.y + _upInset) / _dragingHeight;
if (!_broken) {
CGRect bounds = self.bounds;
_slime.toPoint = _slime.startPoint = CGPointMake(bounds.size.width / 2, _dragingHeight / 2);
_slime.frame = self.bounds;
}
}else {
self.alpha = 0;
}
}

Expand Down

0 comments on commit 03b51e2

Please sign in to comment.