PaperFold-for-iOS icon indicating copy to clipboard operation
PaperFold-for-iOS copied to clipboard

"Jump" when closing top fold and opening bottom fold

Open funkyboy opened this issue 13 years ago • 3 comments

  1. Download the current master and run the project PaperFold.xcodeproj.
  2. Slide down to open the top fold.
  3. Then slide up very slowly.
  4. 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?

funkyboy avatar Dec 05 '12 22:12 funkyboy

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

honcheng avatar Dec 06 '12 01:12 honcheng

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

funkyboy avatar Dec 06 '12 10:12 funkyboy

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.

honcheng avatar Dec 06 '12 10:12 honcheng