You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Clarify. draganjovev is correct, but I disagree with his solution. His solution results in the following odd behaviour. If you setup the use case as he describes and slightly try to scroll (but make sure the page lands on the same one - i.e. no actual change page occurs) then the delegate gets fired when it should not get fired.
I propose that the solution is to swap lines 291 and 292 in -(void) selectPage:(int)page. That was the current page and previous page are recorded as the same when you use this method. If you then manually change page the delegate gets fired, but it you happen to nudge the page and it moves back to center (no page change really occurred), then the delegate wont get fired.
Steps to reproduce issue
scrollLayer = [[CCScrollLayer alloc] initWithLayers:someLayers
widthOffset:0];
[scrollLayer selectPage:1];
[scrollLayer setDelegate:self];
[self addChild:scrollLayer];
NSLog(@"Delegate called");
}
Since you're on page 1, try to go to page 0 and you will see that delegate method is not called because currentScreen_ and prevScreen_ are equal.
Solution si to replace line 119 to
currentScreen_ = NSNotFound;
The text was updated successfully, but these errors were encountered: