Fixes a bug in which incorrect offsets were passed with touch drags. In elproto.drag, x and y are initialized to e.clientX and e.clientY respectively, but then there is code to update those values for touch events. Ultimately, the updated x and y values are added to scrollX/scrollY and then stored in this._drag.x/this._drag.y. The values passed along to eve("raphael.drag.start.", ...) were e.clientX + scrollX/e.clientY + scrollY which are the initial pre-corrected values. With this PR, the corrected values this._drag.x/this._drag.y are passed instead, which fixes the behavior for touch drags.
We ran into this in our application CODAP where we fixed it in our local embedded copy of Raphael in CODAP PR #223.
Fixes a bug in which incorrect offsets were passed with touch drags. In
elproto.drag
,x
andy
are initialized toe.clientX
ande.clientY
respectively, but then there is code to update those values for touch events. Ultimately, the updatedx
andy
values are added toscrollX/scrollY
and then stored inthis._drag.x/this._drag.y
. The values passed along toeve("raphael.drag.start.", ...)
weree.clientX + scrollX/e.clientY + scrollY
which are the initial pre-corrected values. With this PR, the corrected valuesthis._drag.x/this._drag.y
are passed instead, which fixes the behavior for touch drags.We ran into this in our application CODAP where we fixed it in our local embedded copy of Raphael in CODAP PR #223.