Skip to content

Commit

Permalink
Quickfix of strange issue where left drawer gets blank
Browse files Browse the repository at this point in the history
mutualmobile#30

For some reason self.centerContainerView.frame.origin.x is sometimes being set to 0.5 at the end of close animation. This causes drawerFullyCovered to be incorrectly set to false. 

Note: This is just a quickfix. The actual reason of why origin.x is being set to 0.5 in the first place should be investigated and corrected in a future version.
  • Loading branch information
antonholmquist committed Nov 13, 2013
1 parent 0f18f20 commit 1c1f79a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ -(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated velocity:
[self setAnimatingDrawer:animated];
UIViewController * sideDrawerViewController = [self sideDrawerViewControllerForSide:drawerSide];
CGRect visibleRect = CGRectIntersection(self.childControllerContainerView.bounds,sideDrawerViewController.view.frame);

// Quickfix of strange issue where left drawer gets blank
// https://github.com/mutualmobile/MMDrawerController/issues/30
// For some reason self.centerContainerView.frame.origin.x is sometimes being set to 0.5
// at the end of close animation. This causes drawerFullyCovered to be incorrectly set to false.
// Note: This is just a quickfix. The actual reason of why origin.x is being set to 0.5 in
// the first place should be investigated and corrected in a future version.
CGRect centerContainerViewFrame = self.centerContainerView.frame;
if (centerContainerViewFrame.origin.x == 0.5) {
centerContainerViewFrame.origin.x = 0;
self.centerContainerView.frame = centerContainerViewFrame;
}

BOOL drawerFullyCovered = (CGRectContainsRect(self.centerContainerView.frame, visibleRect) ||
CGRectIsNull(visibleRect));
if(drawerFullyCovered){
Expand Down

0 comments on commit 1c1f79a

Please sign in to comment.