Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index logic error #1

Open
ChrisBeeson opened this issue Jan 14, 2014 · 2 comments
Open

index logic error #1

ChrisBeeson opened this issue Jan 14, 2014 · 2 comments

Comments

@ChrisBeeson
Copy link

This seems to fix an issue with adding the wrong index to new left pages

while (leftEdge > minimumVisible) { leftEdge = [self placeNewViewOnLeft:leftEdge withIndex: (_min < 0 ? (_min=_count-1) : _min--)]; }
@natbro
Copy link
Owner

natbro commented Jan 15, 2014

i'm not seeing it - can you give me an example? the way i'm reading it we always start with _min=0, meaning the initial left-/top-most view has been assigned index 0. if we then scroll the contents right/down and expose enough space we will hit this loop and want to assign a new index to the space. your proposed logic change would assign 0 to the next exposed item, because you post-decrement with _min--. if i change to your logic in the provided sample i end up with boxes displaying ... |119| | 0 | | 0 | | 1 | .... this is not to say there's not a case i'm not seeing where perhaps it doesn't get this right (maybe when a very large scroll happens and exposes many items at once or a whole screenful??) just that if you have an example or screenshots i'd be happy to take a look.

@ChrisBeeson
Copy link
Author

Ah interesting...

In my situation I get away from the "join" of 119 | 0 quickly and have restricted the scroller to never scroll left across this join.

The error I found was when I was scrolling pages bigger than the scrollView. Scrolling right right right, and then left - would generate repeat left pages and screw everything up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants