Permalink
Browse files

Merge branch 'master' of github.com:Inferis/ViewDeck

  • Loading branch information...
2 parents 7f1857a + f962a7d commit 927ca10f581c3875427af09656c7be5d4ad4ff10 @Inferis Inferis committed May 31, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 ViewDeck/IIViewDeckController.m
  2. +1 −1 ViewDeck/WrapController.m
@@ -694,7 +694,7 @@ - (BOOL)rightControllerIsClosed {
}
- (BOOL)leftControllerIsOpen {
- return self.leftController && CGRectGetMinX(self.slidingControllerView.frame) > 0 && CGRectGetMinX(self.slidingControllerView.frame) <= self.leftLedge;
+ return self.leftController && CGRectGetMinX(self.slidingControllerView.frame) < self.referenceBounds.size.width && CGRectGetMinX(self.slidingControllerView.frame) >= self.rightLedge;
}
- (BOOL)rightControllerIsOpen {
@@ -1108,7 +1108,7 @@ - (CGFloat)locationOfPanner:(UIPanGestureRecognizer*)panner {
if (!self.rightController) x = MAX(0, x);
CGFloat w = self.referenceBounds.size.width;
- CGFloat lx = MAX(MIN(x, w-self.leftLedge), -w+self.rightLedge);
+ CGFloat lx = fmaxf(fminf(x, w-self.leftLedge), -w+self.rightLedge);
if (self.elastic) {
CGFloat dx = ABS(x) - ABS(lx);
@@ -38,7 +38,7 @@
#endif
#define II_CGRectOffsetRightAndShrink(rect, offset) ({__typeof__(rect) __r = (rect); __typeof__(offset) __o = (offset); (CGRect) { __r.origin.x, __r.origin.y, __r.size.width-__o, __r.size.height }; })
-#define II_CGRectOffsetTopAndShrink(rect, offset) ({__typeof__(rect) __r = (rect); __typeof__(offset) __o = (offset); (CGRect) { __r.origin.x, __r.origin.y + __o, __r.size.width, __r.size.height-__o }; })
+#define II_CGRectOffsetTopAndShrink(rect, offset) ({__typeof__(rect) __r = (rect); __typeof__(offset) __o = (offset); (CGRect) {{ __r.origin.x, __r.origin.y + __o}, {__r.size.width, __r.size.height-__o }}; })
#define II_CGRectOffsetBottomAndShrink(rect, offset) ({__typeof__(rect) __r = (rect); __typeof__(offset) __o = (offset); (CGRect) { __r.origin.x, __r.origin.y, __r.size.width, __r.size.height-__o }; })
#define II_CGRectShrink(rect, w, h) ({__typeof__(rect) __r = (rect); __typeof__(w) __w = (w); __typeof__(h) __h = (h); (CGRect) { __r.origin, __r.size.width - __w, __r.size.height - __h }; })

0 comments on commit 927ca10

Please sign in to comment.