summaryrefslogtreecommitdiff
path: root/morphic.js
diff options
context:
space:
mode:
authorNathan Dinsmore <queryselector@gmail.com>2013-04-13 13:28:36 -0400
committerNathan Dinsmore <queryselector@gmail.com>2013-04-13 13:28:36 -0400
commit25dfe21d66825409171d14a60db7a79df53bd192 (patch)
tree3ec93770e9cc474b2f446658f78c15bc428d23f1 /morphic.js
parent15718f44a30a022a5f45001f3fd2d506da504ff1 (diff)
downloadsnap-25dfe21d66825409171d14a60db7a79df53bd192.tar.gz
snap-25dfe21d66825409171d14a60db7a79df53bd192.zip
Fixed #41
Dragging morphs will no longer throw a TypeError.
Diffstat (limited to 'morphic.js')
-rw-r--r--morphic.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/morphic.js b/morphic.js
index 86f6f39..0cf4b12 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);
+ }
}
-
}
/*