diff --git a/test/util/MockEvents.js b/test/util/MockEvents.js index f0fdbd9e..ebb82691 100644 --- a/test/util/MockEvents.js +++ b/test/util/MockEvents.js @@ -24,10 +24,13 @@ function createCanvasEvent(position, data) { var target = canvas._svg; var clientRect = canvas._container.getBoundingClientRect(); - position.x += clientRect.left; - position.y += clientRect.top; - return createEvent(target, position, data); + var absolutePosition = { + x: position.x + clientRect.left, + y: position.y + clientRect.top + }; + + return createEvent(target, absolutePosition, data); }); }