How to calculate the scroll distance using velocity? #1011
Unanswered
Deepak1799
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I think the correct way (not tested though yet) would be to use the deceleration to calculate how long the inertia is taking effect to then calculate the distance based on that time. Maybe this 8 is the magic number for how long this takes but I have no idea where this is coming from. Do you happen to have a 120Hz display? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using WinUI Scroll Viewer and want to disable its built-in manipulations to achieve my other requirements. So the default fling scrolling is not working.
What I am trying to achieve fling scrolling is, I am using the velocity obtained from ManipulationInertiaStarting event to detect fling action.
I am getting the proper velocity, but I am unable to find a proper calculation to find the distance to which the control should scroll using the velocity values.
The only thing I know is distance is directly proportional to velocity. So I am using an hard-coded proportion factor. Can anyone please advice me whether this is correct or there is any proper way (formula) to calculate the scroll distance using velocity?
Code snippet:
Provide manipulate mode and wire inertia event
Calculate distance On Event Handler
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions