Skip to content

Commit

Permalink
Merge pull request #16 from dexcell/master
Browse files Browse the repository at this point in the history
Fixed scale bug
  • Loading branch information
KieranLafferty committed Mar 15, 2013
2 parents a71eb2f + ee38377 commit fe2e9ed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Classes/KLNoteViewController.m
Expand Up @@ -121,7 +121,7 @@ - (CGFloat) defaultVerticalOriginForControllerCard: (KLControllerCard*) controll
CGFloat originOffset = 0;
for (int i = 0; i < index; i ++) {
CGFloat scalingFactor = [self scalingFactorForIndex: i];
NSLog(@"%@", controllerCard.navigationController.navigationBar);
// NSLog(@"%@", controllerCard.navigationController.navigationBar);
originOffset += scalingFactor * controllerCard.navigationController.navigationBar.frame.size.height * self.cardNavigationBarOverlap;
}

Expand Down Expand Up @@ -328,7 +328,7 @@ -(id) initWithNoteViewController: (KLNoteViewController*) noteView navigationCon
index = _index;
originY = [noteView defaultVerticalOriginForControllerCard:self
atIndex: index];
[self setFrame: self.navigationController.view.bounds];
[self setFrame: noteView.view.bounds];

//Initialize the view's properties
[self setAutoresizesSubviews:YES];
Expand Down Expand Up @@ -488,9 +488,20 @@ - (void) setState:(KLControllerCardState)state animated:(BOOL) animated{
if (animated) {
[UIView animateWithDuration:self.noteViewController.cardAnimationDuration animations:^{
[self setState:state animated:NO];
} completion:^(BOOL finished) {
if (state == KLControllerCardStateFullScreen) {
// Fix scaling bug when expand to full size
self.frame = self.noteViewController.view.bounds;
self.navigationController.view.frame = self.frame;
self.navigationController.view.layer.cornerRadius = 0;
}
}];
return;
}

// Set corner radius
[self.navigationController.view.layer setCornerRadius: self.noteViewController.cardCornerRadius];

//Full Screen State
if (state == KLControllerCardStateFullScreen) {
[self expandCardToFullSize: animated];
Expand Down

0 comments on commit fe2e9ed

Please sign in to comment.