             menuView.frame.origin.x = SideMenuTransition.presentDirection == .Left ? -menuView.frame.width : mainViewController.view.frame.width
             mainViewController.view.frame.origin.x = 0
             
+            // Restore mainViewController.view.frame to avoid wrong frame after device rotation
+            if SideMenuManager.menuAnimationTransformScaleFactor != 1 {
+                let rect = SideMenuManager.appScreenRect
+                mainViewController.view.frame = CGRect(x: 0, y: 0, width: rect.width, height: rect.height)
+            }
+            
         case .MenuSlideIn:
             menuView.alpha = 1
             menuView.frame.origin.x = SideMenuTransition.presentDirection == .Left ? -menuView.frame.width : mainViewController.view.frame.width

            menuView.frame.origin.x = SideMenuTransition.presentDirection == .Left ? 0 : mainViewController.view.frame.width - SideMenuManager.menuWidth
            mainViewController.view.frame.origin.x = 0
        }
    }
    
    internal class func hideMenuComplete() {

        menuView.transform = CGAffineTransformIdentity
        mainViewController.view.transform = CGAffineTransformIdentity
        mainViewController.view.alpha = 1
        
        menuView.frame.origin.y = 0
        menuView.frame.size.width = SideMenuManager.menuWidth
        menuView.frame.size.height = mainViewController.view.frame.height
        
        SideMenuTransition.statusBarView?.frame = UIApplication.sharedApplication().statusBarFrame
        SideMenuTransition.statusBarView?.alpha = 0
        
