ariatemplates/ariatemplates — pull request #1285 by divdavem (2014-09-04 17:23:41+00:00)
Title: Improving the precision of Drag utility and slider widgets

This PR changes the strategy to compute the new position while dragging a DOM element with the drag utility.

Previously, the new position was computed by using the difference of coordinates between the previous mouse move event and the current mouse move event, thus accumulating rounding errors at each mouse move event. Because of this, the distance between the mouse and the dragged element could increase or decrease significantly while dragging the element.

With this PR, the new position is computed by using the difference of coordinates between the start of the drag (which is a fixed reference) and the current mouse move event, thus making sure the relative position between the mouse and the dragged element stays the same until the mouse is released.