Skip to content

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

Open
thirstycoda wants to merge 4 commits intoShawnLin013:masterfrom
thirstycoda:master
Open

Fixed on click scroll when selected text size and general text size are different#192
thirstycoda wants to merge 4 commits intoShawnLin013:masterfrom
thirstycoda:master

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.

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.

1 participant