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

Fixed on click scroll when selected text size and general text size are different #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thirstycoda
Copy link

Hi,

Thanks for this library. It has been a great help. I have however had 1 small problem when using the following settings:
np_selectedTextSize = 70sp
np_textSize = 30sp
np_wheelItemCount = 7
np_orientation = horizontal

Tapping the selected number causes the picker to decrement and tapping the first number to the right of the selected number causes no scroll.

I believe the cause is the line
int selectorIndexOffset = (eventX / mSelectorElementSize) - mWheelMiddleItemIndex;

If I understand the code correctly, it is assuming all elements are a similar size as it is using the size of the selector to determine which index has been tapped. If the selector element is bigger due to the the selector text size being bigger, the result of this will not be accurate.

…ference between selected text size and general text size
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

Successfully merging this pull request may close these issues.

None yet

1 participant