From 25dfe21d66825409171d14a60db7a79df53bd192 Mon Sep 17 00:00:00 2001 From: Nathan Dinsmore Date: Sat, 13 Apr 2013 13:28:36 -0400 Subject: [PATCH] Fixed #41 Dragging morphs will no longer throw a TypeError. --- morphic.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/morphic.js b/morphic.js index 86f6f39f..0cf4b122 100644 --- a/morphic.js +++ b/morphic.js @@ -9509,14 +9509,15 @@ HandMorph.prototype.processMouseMove = function (event) { this.grab(morph); this.grabOrigin = this.morphToGrab.situation(); } - // if the mouse has left its fullBounds, center it - fb = morph.fullBounds(); - if (!fb.containsPoint(pos)) { - this.bounds.origin = fb.center(); - this.grab(morph); - this.setPosition(pos); + if (morph) { + // if the mouse has left its fullBounds, center it + fb = morph.fullBounds(); + if (!fb.containsPoint(pos)) { + this.bounds.origin = fb.center(); + this.grab(morph); + this.setPosition(pos); + } } - } /*