From faa3ef13cd10dc485400443da2a96fae0b020252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B0=D0=B2=D1=80=D1=91=D0=BD=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=BD?= Date: Fri, 28 Feb 2014 00:07:29 +0800 Subject: [PATCH] fix #431 --- src/DragAndDrop.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/DragAndDrop.js b/src/DragAndDrop.js index 80f86c4e..7579a492 100644 --- a/src/DragAndDrop.js +++ b/src/DragAndDrop.js @@ -95,11 +95,14 @@ Kinetic.Node.prototype._setDragPosition = function(evt) { var dd = Kinetic.DD, pos = this.getStage().getPointerPosition(), - dbf = this.getDragBoundFunc(), - newNodePos = { - x: pos.x - dd.offset.x, - y: pos.y - dd.offset.y - }; + dbf = this.getDragBoundFunc(); + if (!pos) { + return; + } + var newNodePos = { + x: pos.x - dd.offset.x, + y: pos.y - dd.offset.y + }; if(dbf !== undefined) { newNodePos = dbf.call(this, newNodePos, evt);