Commit ad0f931
Philip Withnall
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#981 parent 07d5575 commit ad0f931
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
| |||
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
| 919 | + | |
918 | 920 | | |
919 | 921 | | |
920 | 922 | | |
| |||
927 | 929 | | |
928 | 930 | | |
929 | 931 | | |
| 932 | + | |
930 | 933 | | |
931 | 934 | | |
932 | 935 | | |
| |||
974 | 977 | | |
975 | 978 | | |
976 | 979 | | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
| 980 | + | |
| 981 | + | |
981 | 982 | | |
982 | 983 | | |
983 | 984 | | |
| |||
1301 | 1302 | | |
1302 | 1303 | | |
1303 | 1304 | | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1304 | 1312 | | |
1305 | 1313 | | |
1306 | 1314 | | |
| |||
1736 | 1744 | | |
1737 | 1745 | | |
1738 | 1746 | | |
1739 | | - | |
| 1747 | + | |
1740 | 1748 | | |
1741 | 1749 | | |
1742 | 1750 | | |
| |||
0 commit comments