Skip to content

Commit

Permalink
Merge pull request #16 from enovav/patch-1
Browse files Browse the repository at this point in the history
Fixing incorrect landscape centring
  • Loading branch information
gcamp committed Feb 4, 2013
2 parents 82228a6 + 7c945a4 commit 00dcd08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GCDiscreetNotificationView/GCDiscreetNotificationView.m
Original file line number Diff line number Diff line change
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 00dcd08

Please sign in to comment.