ScrollControls getting stuck when infinite = true #1161
Unanswered
martinaedma
asked this question in
Q&A
Replies: 1 comment
-
Whatever the case might be with this stuck problem. I found that using Mathutils.damp was a much better solution for what I was trying to do, so I'm not using delta. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have following code for Canvas
Inside TextContainer I have useFrame()
scrollDirection is either -1 or 1 taken from onWheel event.
So I am just moving my text container up or down, infinitely, And this works in general, but there 2 situations where scroll.delta wont change and scrolling gets stuck.
First is when scene starts, and scrollbar is in top position. When I try to scroll more upwards from here, scroll.delta is 0, it wont go up. If I move just a bit down, then it will start going up, but not at first.
Second stuck situation occurs when I scroll upwards slowly just so much that scrollbar jumps to bottom -> going for another circle due to infinity -> and here when try to scroll lower, scroll delta is going infinitely smaller, like it wont trigger delta update eventhough I'm scrolling downwards. Once again I have to go once in opposite direction, and only then it will continue going downwards,
First picture is starting scene, scrollbar is in upmost position, but scrolling upwards wont trigger new round , scroll.delta wont change.
Second picture is when I've just went enough upwards that scrollbar jump down for new round, here scrolling downwards wont trigger scroll.delta update. Second picture console shows current Y position of container and scroll.delta value, which is going infinitely smaller.
How can I fix those situations ?
Beta Was this translation helpful? Give feedback.
All reactions