Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
joshvera committed Apr 6, 2014
1 parent 8846e44 commit 26ec75b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Rebel/RBLPopover.m
Expand Up @@ -512,13 +512,15 @@ - (CGPathRef)newPopoverPathForEdge:(CGRectEdge)popoverEdge inFrame:(CGRect)frame
CGFloat minY = NSMinY(contentRect);
CGFloat maxY = NSMaxY(contentRect);

CGFloat midOriginY = floor(NSMaxY(contentRect) * self.popoverAnchorPoint.y);
CGFloat midOriginX = floor(NSMaxX(contentRect) * self.popoverAnchorPoint.x);
CGFloat midOriginX, midOriginY;
if (self.didOffsetFrame) {
CGRect windowRect = [self.window convertRectFromScreen:self.popoverOrigin];
CGRect originRect = [self convertRect:windowRect fromView:nil];
midOriginX = floor(RBLRectsGetMedianX(originRect, contentRect));
midOriginY = floor(RBLRectsGetMedianY(originRect, contentRect));
} else {
midOriginY = floor(NSMaxY(contentRect) * self.popoverAnchorPoint.y);
midOriginX = floor(NSMaxX(contentRect) * self.popoverAnchorPoint.x);
}

CGFloat maxArrowX = 0.0;
Expand Down Expand Up @@ -561,13 +563,10 @@ - (CGPathRef)newPopoverPathForEdge:(CGRectEdge)popoverEdge inFrame:(CGRect)frame

CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, minX, floor(minY + RBLPopoverBackgroundViewBorderRadius));


CGPathAddArc(path, NULL, floor(minX + RBLPopoverBackgroundViewBorderRadius), floor(minY + contentRect.size.height - RBLPopoverBackgroundViewBorderRadius), RBLPopoverBackgroundViewBorderRadius, M_PI, M_PI / 2, 1);


CGPathAddArc(path, NULL, floor(minX + contentRect.size.width - RBLPopoverBackgroundViewBorderRadius), floor(minY + contentRect.size.height - RBLPopoverBackgroundViewBorderRadius), RBLPopoverBackgroundViewBorderRadius, M_PI / 2, 0.0, 1);


CGPathAddArc(path, NULL, floor(contentRect.origin.x + contentRect.size.width - RBLPopoverBackgroundViewBorderRadius), floor(minY + RBLPopoverBackgroundViewBorderRadius), RBLPopoverBackgroundViewBorderRadius, 0.0, -M_PI / 2, 1);

Expand Down

0 comments on commit 26ec75b

Please sign in to comment.