Minor fixes for different setups

This commit is contained in:
Maz Jaleel 2015-11-14 19:14:56 -08:00
parent ab74d0360c
commit 679d5caef1
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,7 @@
return delta;
}
if (normalizedY < 0)
if (normalizedY < -FLT_EPSILON)
{
CGRect frame = self.scrollView.frame;
frame = UIEdgeInsetsInsetRect(frame, insets);

View File

@ -267,6 +267,9 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
self.resistanceConsumed = 0;
}
// GTH: Calculate the exact point to avoid expansion resistance
// CGFloat statusBarHeight = [self.statusBarController calculateTotalHeightRecursively];
// 5 - Apply resistance
// 5.1 - Always apply resistance when contracting
if (self.contracting)
@ -277,7 +280,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
deltaY = MIN(0, availableResistance + deltaY);
}
// 5.2 - Only apply resistance if expanding above the status bar
else if (self.scrollView.contentOffset.y > -[self.statusBarController calculateTotalHeightRecursively])
else if (self.scrollView.contentOffset.y > 0)
{
CGFloat availableResistance = self.expansionResistance - self.resistanceConsumed;
self.resistanceConsumed = MIN(self.expansionResistance, self.resistanceConsumed + deltaY);