diff options
| author | Nathan Dinsmore <queryselector@gmail.com> | 2013-04-13 13:28:36 -0400 |
|---|---|---|
| committer | Nathan Dinsmore <queryselector@gmail.com> | 2013-04-13 13:28:36 -0400 |
| commit | 25dfe21d66825409171d14a60db7a79df53bd192 (patch) | |
| tree | 3ec93770e9cc474b2f446658f78c15bc428d23f1 /morphic.js | |
| parent | 15718f44a30a022a5f45001f3fd2d506da504ff1 (diff) | |
| download | snap-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.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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); + } } - } /* |
