Is there any algorithm for inertia scrolling like Mac has. I want to write a java application which would implement that algorithm. this is just a fun little project.
any help would greatly appreciated
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just store the time when the user clicked and released the mouse. Use those times to make a velocity in terms of lines to scroll per second. Then add a decay to the speed; a deceleration if you will – you can either have it decrease at a constant rate, or go for a set period of time.