From 486d30ecefcc887cb1c6be1fdabdfc1feb31c320 Mon Sep 17 00:00:00 2001 From: Sjaak Schilperoort Date: Wed, 30 Mar 2016 14:09:31 +0200 Subject: [PATCH] Fix animations when reveal overdraw is set to zero --- SWRevealViewController/SWRevealViewController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SWRevealViewController/SWRevealViewController.m b/SWRevealViewController/SWRevealViewController.m index d378d13..39dc335 100755 --- a/SWRevealViewController/SWRevealViewController.m +++ b/SWRevealViewController/SWRevealViewController.m @@ -1369,8 +1369,9 @@ - (void)_dispatchPushFrontViewController:(UIViewController *)newFrontViewControl NSTimeInterval duration = animated?_toggleAnimationDuration:0.0; NSTimeInterval firstDuration = duration; NSInteger initialPosDif = ABS( _frontViewPosition - preReplacementPosition ); - if ( initialPosDif == 1 ) firstDuration *= 0.8; - else if ( initialPosDif == 0 ) firstDuration = 0; + CGFloat revealOverdraw = preReplacementPosition == FrontViewPositionRightMost ? _rearViewRevealOverdraw : _rightViewRevealOverdraw; + if ( initialPosDif == 1 && revealOverdraw != 0.0f ) firstDuration *= 0.8; + else if ( initialPosDif == 0 || revealOverdraw == 0.0f ) firstDuration = 0; __weak SWRevealViewController *theSelf = self; if ( animated )