Skip to content

Commit

Permalink
Merge pull request #1044 from DV3D/patch-1
Browse files Browse the repository at this point in the history
Update moveToObject.js
  • Loading branch information
christian-bromann committed Jan 21, 2016
2 parents 596b877 + b7fcf06 commit b73635f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/commands/moveToObject.js
Expand Up @@ -45,12 +45,12 @@ module.exports = function moveToObject(selector, xoffset, yoffset) {
});
});
}).then(function(res) {
var x = res.location.value.x,
y = res.location.value.y;
var x = res.location.value.x + (res.size.value.width / 2),
y = res.location.value.y + (res.size.value.height / 2);

if(hasOffsetParams) {
x = res.location.value.x - (res.size.value.width / 2) + xoffset;
y = res.location.value.y - (res.size.value.height / 2) + yoffset;
x = res.location.value.x + xoffset;
y = res.location.value.y + yoffset;
}

return this.touchMove(x, y);
Expand Down

0 comments on commit b73635f

Please sign in to comment.