Skip to content

Commit

Permalink
Fixing incorrect landscape centring
Browse files Browse the repository at this point in the history
  • Loading branch information
enovav committed Feb 4, 2013
1 parent 82228a6 commit 7c945a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GCDiscreetNotificationView/GCDiscreetNotificationView.m
Expand Up @@ -345,15 +345,15 @@ - (BOOL) isShowing {
- (CGPoint) showingCenter {
CGFloat y = 0;
if (self.presentationMode == GCDiscreetNotificationViewPresentationModeTop) y = 15;
else if (self.presentationMode == GCDiscreetNotificationViewPresentationModeBottom) y = self.view.frame.size.height - 15;
return CGPointMake(self.view.frame.size.width / 2, y);
else if (self.presentationMode == GCDiscreetNotificationViewPresentationModeBottom) y = self.view.bounds.size.height - 15;
return CGPointMake(self.view.bounds.size.width / 2, y);
}

- (CGPoint) hidingCenter {
CGFloat y = 0;
if (self.presentationMode == GCDiscreetNotificationViewPresentationModeTop) y = - 15;
else if (self.presentationMode == GCDiscreetNotificationViewPresentationModeBottom) y = 15 + self.view.frame.size.height;
return CGPointMake(self.view.frame.size.width / 2, y);
else if (self.presentationMode == GCDiscreetNotificationViewPresentationModeBottom) y = 15 + self.view.bounds.size.height;
return CGPointMake(self.view.bounds.size.width / 2, y);
}

#pragma mark -
Expand Down

0 comments on commit 7c945a4

Please sign in to comment.