elm/scrollable: Avoid division by zero during scroll.
authorRafael Antognolli <rafael.antognolli@intel.com>
Wed, 5 Jun 2013 22:14:59 +0000 (19:14 -0300)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 6 Jun 2013 17:24:37 +0000 (14:24 -0300)
commit74710bbd81a26f888b0d19c012a95da8440ac2c9
tree0ac96a71dd9ac09890128ede02654b3b447189ae
parentc0f42a5932b35ccb56c01d11d05adbb3bd5f4542
elm/scrollable: Avoid division by zero during scroll.

When several mouse move events arrive with the same timestamps, the
calculation done to get an average of movement will try to divide things
by zero. This fix will make it ignore this calculation and just go back
to assuming that there's only one last move event.

Such behavior can happen on wayland backend, when using the X11 backend
for Weston, since it will process several X events in one loop iteration
and send all of them with the same timestamp.
src/lib/elm_interface_scrollable.c