Merge pull request #2465 from imurchie/isaac-gestures

In swipe, translate milliseconds to seconds
This commit is contained in:
Jonathan Lipps
2014-05-02 18:06:12 -07:00

View File

@@ -267,12 +267,14 @@ exports.performTouch = function (req, res) {
// press-wait-moveTo-release is `swipe`, so use native method
if (gestures.length === 4) {
if ((gestures[0].action === 'press') && (gestures[1].action === 'wait') && (gestures[2].action === 'moveTo') && (gestures[3].action === 'release')) {
// the touch action api uses ms, we want seconds
var duration = gestures[1].options.ms / 1000;
var body = {
startX: gestures[0].options.x,
startY: gestures[0].options.y,
endX: gestures[2].options.x,
endY: gestures[2].options.y,
duration: gestures[1].options.ms
duration: duration
};
req.body = body;
return exports.mobileSwipe(req, res);