Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kinetic-scroll-view: Grow the motion buffer over time
The motion buffer contains a history of motion events for the current scrolling action, starting from the initial touch event. This is used at the release of the scroll to work out an average origin coordinate, which is then used in the calculation of whether to use kinetic scrolling. Previously, the oldest entry in the motion buffer was removed if the buffer filled up, then the buffer was expanded in size. This meant that for scrolling actions with many motion events, the average taken over the events would quickly creep towards the location of the most recent motion event. This meant that, often, the threshold for starting a kinetic scroll was not reached, and hence kinetic scrolling would not happen. Stop removing the oldest entry from the buffer, and instead grow it indefinitely. This does make the widget prone to consuming all the system’s memory if the user scrolls around for a _very_ long time. This may be better fixed by calculating a moving average instead, and eliminating the motion buffer. clutter-project#98
- Loading branch information