"Jump" when closing top fold and opening bottom fold
- Download the current master and run the project PaperFold.xcodeproj.
- Slide down to open the top fold.
- Then slide up very slowly.
- You will notice that, as soon as you get to close the top fold the bottom fold is completely open.
The same happens when you slowly close the bottom fold.
I'd like to help. Can you point me into the right direction?
I suspect it has to do with the state. Maybe the moment the bottom fold opens, it uses the last displacement distance if your gesture, instead of resetting to 0
In
- (void)animateWithContentOffset:(CGPoint)point panned:(BOOL)panned
I have added a return statement when y is 0 and this solved my issue
else if (self.paperFoldInitialPanDirection==PaperFoldInitialPanDirectionVertical) {
float y = point.y;
if (self.state!=self.lastState) self.lastState = self.state;
if(y == 0)
return;
This solved my issue
Thanks. Really appreciate this. I'll try to incorporate this solution, after I test that it doesn't affect anything else.
On 6 Dec, 2012, at 6:08 PM, Cesare [email protected] wrote:
In
- (void)animateWithContentOffset:(CGPoint)point panned:(BOOL)panned
I have added a return statement when y is 0 and this solved my issue
else if (self.paperFoldInitialPanDirection==PaperFoldInitialPanDirectionVertical) {
float y = point.y; if (self.state!=self.lastState) self.lastState = self.state; if(y == 0) return;This solved my issue
— Reply to this email directly or view it on GitHub.