Skip to content

Commit

Permalink
Add comments to ledge bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmpatierno committed Feb 9, 2012
1 parent 97d63f4 commit c5bc634
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ViewDeck/IIViewDeckController.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ - (CGSize)slidingSizeForOffset:(CGFloat)offset {
#pragma mark - ledges

- (void)setLeftLedge:(CGFloat)leftLedge {
// Compute the final ledge in two steps. This prevents a strange bug where
// nesting MAX(X, MIN(Y, Z)) with miniscule referenceBounds returns a bogus near-zero value.
CGFloat minLedge = MIN(self.referenceBounds.size.width, leftLedge);
leftLedge = MAX(leftLedge, minLedge);
if (_viewAppeared && II_FLOAT_EQUAL(self.slidingControllerView.frame.origin.x, self.referenceBounds.size.width - _leftLedge)) {
Expand All @@ -277,6 +279,8 @@ - (void)setLeftLedge:(CGFloat)leftLedge {
}

- (void)setRightLedge:(CGFloat)rightLedge {
// Compute the final ledge in two steps. This prevents a strange bug where
// nesting MAX(X, MIN(Y, Z)) with miniscule referenceBounds returns a bogus near-zero value.
CGFloat minLedge = MIN(self.referenceBounds.size.width, rightLedge);
rightLedge = MAX(rightLedge, minLedge);
if (_viewAppeared && II_FLOAT_EQUAL(self.slidingControllerView.frame.origin.x, _rightLedge - self.referenceBounds.size.width)) {
Expand Down

0 comments on commit c5bc634

Please sign in to comment.