From 2807129585f528161eb9a86aa61cf66d5fc09904 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 20 Oct 2015 10:50:48 +0200 Subject: [PATCH] chore(test): fix mock events patching argument --- test/util/MockEvents.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); }); }