{"id":0,"registry":{"0":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":1},"id":"1E262BB0-B5EB-43C7-AEEF-1721047BD34B","eventHandler":{"__isSmartRef__":true,"id":4},"__layered_droppingEnabled__":true,"halosEnabled":true,"isBeingDragged":false,"controlPoints":[{"__isSmartRef__":true,"id":5},{"__isSmartRef__":true,"id":6}],"showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":7},"name":"Connector","derivationIds":[731,"5E6BD741-9C99-47B9-95C1-7A028178DB17","A8D5C37A-F23F-47FE-8DE2-211CE4484A4F","F722069B-8602-4E8D-BE3F-92A1E0C0EF28","D5ED19F9-968E-4C7E-9936-69F2735A813F","A9E370BC-F208-425C-BFFC-F8D6BB52E11F","4E431641-D056-46CB-B2A8-6626382EF423","5E9FF80A-8869-4D30-9A4C-37023352650B"],"_ClipMode":"visible","controlPointsHalos":[],"prevScroll":[0,0],"grabbingEnabled":false,"moved":true,"#startLetters":"controlPoints[0]","update":{"__isSmartRef__":true,"id":21},"isCopyMorphRef":true,"morphRefId":2,"selectedMorphHighlights":null,"_Rotation":0,"_Scale":1,"__serializedExpressions__":["distanceToDragEvent","_Position"],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":23},"__LivelyClassName__":"lively.morphic.Path","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","distanceToDragEvent":"lively.pt(111.1,-12.5)","_Position":"lively.pt(0.0,0.0)"},"1":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":2},{"__isSmartRef__":true,"id":3}],"_ClipMode":"visible","_BorderWidth":3.1119999999999997,"_Fill":null,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_AppearanceStylingMode":false,"_BorderStylingMode":false,"__serializedExpressions__":["_Padding","_Position","_Extent","_BorderColor"],"__LivelyClassName__":"lively.morphic.Shapes.Path","__SourceModuleName__":"Global.lively.morphic.PathShapes","_Padding":"lively.rect(0,0,0,0)","_Position":"lively.pt(-85.6,-18.5)","_Extent":"lively.pt(171.2,37.0)","_BorderColor":"Color.rgb(161,161,161)"},"2":{"isAbsolute":true,"x":84.58408408408422,"y":17.517017017016997,"__LivelyClassName__":"lively.morphic.Shapes.MoveTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"3":{"isAbsolute":true,"x":-83.58408408408411,"y":-16.517017017017224,"__LivelyClassName__":"lively.morphic.Shapes.LineTo","__SourceModuleName__":"Global.lively.morphic.PathShapes"},"4":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"5":{"morph":{"__isSmartRef__":true,"id":0},"index":0,"connectedMagnet":null,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"6":{"morph":{"__isSmartRef__":true,"id":0},"index":1,"connectedMagnet":null,"__LivelyClassName__":"lively.morphic.ControlPoint","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs"},"7":{"requiredModules":[],"migrationLevel":4,"partsSpaceName":"PartsBin/Jens/","comment":"Yes, I think I got it again: Powerful and nice connectors.\nThis time 100 % Part only!","partName":"Connector","lastModifiedDate":{"__isSmartRef__":true,"id":8},"changes":[{"__isSmartRef__":true,"id":9},{"__isSmartRef__":true,"id":11},{"__isSmartRef__":true,"id":13},{"__isSmartRef__":true,"id":15},{"__isSmartRef__":true,"id":17},{"__isSmartRef__":true,"id":19}],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin"},"8":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:37:16 GMT+0100 (CET)"},"9":{"date":{"__isSmartRef__":true,"id":10},"author":"jenslincke","message":"no comment","id":"ED70FB47-8AA0-4D4E-8D90-FF99454C924B"},"10":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:37:32 GMT+0100 (CET)"},"11":{"date":{"__isSmartRef__":true,"id":12},"author":"jenslincke","message":"no comment","id":"28165CED-C8C5-4B8E-9655-645E3F5099BB"},"12":{"isSerializedDate":true,"string":"Thu Dec 13 2012 09:54:42 GMT+0100 (CET)"},"13":{"date":{"__isSmartRef__":true,"id":14},"author":"jenslincke","message":"no comment","id":"117C964B-9768-48F2-8EC8-D4328478198F"},"14":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:05:07 GMT+0100 (CET)"},"15":{"date":{"__isSmartRef__":true,"id":16},"author":"jenslincke","message":"no comment","id":"79159460-DFFB-462D-AFC9-EECD3539A1A9"},"16":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:32:27 GMT+0100 (CET)"},"17":{"date":{"__isSmartRef__":true,"id":18},"author":"jenslincke","message":"no comment","id":"3D5067AE-5BA0-4317-837F-59F8F61B8B24"},"18":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:35:06 GMT+0100 (CET)"},"19":{"date":{"__isSmartRef__":true,"id":20},"author":"jenslincke","message":"fixed scaling issues","id":"97E95E76-A88F-44AB-A6E9-6BA5DCC4045D"},"20":{"isSerializedDate":true,"string":"Tue Dec 18 2012 10:41:43 GMT+0100 (CET)"},"21":{"d":1,"a":1,"f":906.1,"e":107.8,"c":0,"b":0,"matrix_":{"__isSmartRef__":true,"id":22},"__LivelyClassName__":"lively.morphic.Similitude","__SourceModuleName__":"Global.lively.morphic.Graphics"},"22":{"a":1,"b":0,"c":0,"d":1,"e":107.8,"f":906.1,"__LivelyClassName__":"lively.morphic.Similitude","__SourceModuleName__":"Global.lively.morphic.Graphics"},"23":{"connect":{"__isSmartRef__":true,"id":24},"updatePosition":{"__isSmartRef__":true,"id":28},"updateControlPoint":{"__isSmartRef__":true,"id":32},"disconnectMorph":{"__isSmartRef__":true,"id":36},"connectMorph":{"__isSmartRef__":true,"id":40},"onMouseOver":{"__isSmartRef__":true,"id":44},"onMouseOut":{"__isSmartRef__":true,"id":48},"makeHandle":{"__isSmartRef__":true,"id":56},"showFromHandle":{"__isSmartRef__":true,"id":60},"showToHandle":{"__isSmartRef__":true,"id":64},"reset":{"__isSmartRef__":true,"id":68},"onDragInHandle":{"__isSmartRef__":true,"id":72},"onDragStartInHandle":{"__isSmartRef__":true,"id":76},"onDragEndInHandle":{"__isSmartRef__":true,"id":80},"connectFrom":{"__isSmartRef__":true,"id":84},"connectTo":{"__isSmartRef__":true,"id":88},"hideToHandle":{"__isSmartRef__":true,"id":92},"hideFromHandle":{"__isSmartRef__":true,"id":96},"updateIntersection":{"__isSmartRef__":true,"id":100},"lineIntersect":{"__isSmartRef__":true,"id":104},"intersectMorphLinePoints":{"__isSmartRef__":true,"id":108},"intersectMorph":{"__isSmartRef__":true,"id":112},"globalShapePathFromMorph":{"__isSmartRef__":true,"id":116},"remove":{"__isSmartRef__":true,"id":120}},"24":{"varMapping":{"__isSmartRef__":true,"id":25},"source":"function connect(morphA, morphB) {\n    this.connectFrom(morphA)\n    this.connectTo(morphB)\n    this.updatePosition()\n}","funcProperties":{"__isSmartRef__":true,"id":26},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"25":{"this":{"__isSmartRef__":true,"id":0}},"26":{"timestamp":{"__isSmartRef__":true,"id":27},"user":"jenslincke","tags":[]},"27":{"isSerializedDate":true,"string":"Thu Dec 13 2012 16:50:49 GMT+0100 (CET)"},"28":{"varMapping":{"__isSmartRef__":true,"id":29},"source":"function updatePosition() {\n    this.updateControlPoint(this.controlPoints[0], this.fromMorph)\n    this.updateControlPoint(this.controlPoints[1], this.toMorph)\n    this.updateIntersection(this.fromMorph, this.controlPoints[0])\n    this.updateIntersection(this.toMorph, this.controlPoints[1])\n\n    this.adjustOrigin(this.bounds().extent().scaleBy(0.5))\n}","funcProperties":{"__isSmartRef__":true,"id":30},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"29":{"this":{"__isSmartRef__":true,"id":0}},"30":{"timestamp":{"__isSmartRef__":true,"id":31},"user":"jenslincke","tags":[]},"31":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:06:20 GMT+0100 (CET)"},"32":{"varMapping":{"__isSmartRef__":true,"id":33},"source":"function updateControlPoint(cp, morph) {\n    if (!cp || !morph) return;\n    cp.setGlobalPos(morph.worldPoint(morph.shape.bounds().center()))\n}","funcProperties":{"__isSmartRef__":true,"id":34},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"33":{"this":{"__isSmartRef__":true,"id":0}},"34":{"timestamp":{"__isSmartRef__":true,"id":35},"user":"jenslincke","tags":[]},"35":{"isSerializedDate":true,"string":"Thu Dec 13 2012 11:45:56 GMT+0100 (CET)"},"36":{"varMapping":{"__isSmartRef__":true,"id":37},"source":"function disconnectMorph(morph) {\n    if (!morph) return;\n    lively.bindings.disconnect(morph, 'globalTransform', this, 'updatePosition')\n}","funcProperties":{"__isSmartRef__":true,"id":38},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"37":{"this":{"__isSmartRef__":true,"id":0}},"38":{"timestamp":{"__isSmartRef__":true,"id":39},"user":"jenslincke","tags":[]},"39":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:19:18 GMT+0100 (CET)"},"40":{"varMapping":{"__isSmartRef__":true,"id":41},"source":"function connectMorph(morph) {\n    if (morph)\n        lively.bindings.connect(morph, 'globalTransform', this, 'updatePosition')\n}","funcProperties":{"__isSmartRef__":true,"id":42},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"41":{"this":{"__isSmartRef__":true,"id":0}},"42":{"timestamp":{"__isSmartRef__":true,"id":43},"user":"jenslincke","tags":[]},"43":{"isSerializedDate":true,"string":"Thu Dec 13 2012 11:52:12 GMT+0100 (CET)"},"44":{"varMapping":{"__isSmartRef__":true,"id":45},"source":"function onMouseOver(evt) {\n    var p = evt.getPosition()\n    var cp1 = this.controlPoints[0].getGlobalPos();\n    if (p.dist(cp1) < 20) {\n        this.showFromHandle()\n    } else {\n        this.hideFromHandle()\n    }\n    var cp2 = this.controlPoints[1].getGlobalPos();\n    if (p.dist(cp2) < 20) {\n        this.showToHandle()\n    } else {\n        this.hideToHandle()\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":46},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"45":{"this":{"__isSmartRef__":true,"id":0}},"46":{"timestamp":{"__isSmartRef__":true,"id":47},"user":"jenslincke","tags":[]},"47":{"isSerializedDate":true,"string":"Tue Dec 18 2012 10:41:13 GMT+0100 (CET)"},"48":{"varMapping":{"__isSmartRef__":true,"id":49},"source":"function onMouseOut(evt) {\n    // this.hideFromHandle()\n    // this.hideToHandle()\n}","funcProperties":{"__isSmartRef__":true,"id":54},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"49":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":50}},"50":{"$super":{"__isSmartRef__":true,"id":51}},"51":{"varMapping":{"__isSmartRef__":true,"id":52},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":53},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"52":{"obj":{"__isSmartRef__":true,"id":0},"name":"onMouseOut"},"53":{},"54":{"timestamp":{"__isSmartRef__":true,"id":55},"user":"jenslincke","tags":[]},"55":{"isSerializedDate":true,"string":"Thu Dec 13 2012 16:54:53 GMT+0100 (CET)"},"56":{"varMapping":{"__isSmartRef__":true,"id":57},"source":"function makeHandle() {\n    var m = lively.morphic.Morph.makeRectangle(0,0,10,10);\n    m.disableGrabbing()\n    m.enableDragging()\n    m.connector = this;\n    // move real behavior to a place which is easier to develop\n    // do not use bind, because we like late binding \n    m.addScript(function onDragStart(evt) {\n        this.connector.onDragStartInHandle(this, evt)\n    })\n    m.addScript(function onDrag(evt) {\n        this.connector.onDragInHandle(this, evt)\n    })\n    m.addScript(function onDragEnd(evt) {\n        this.connector.onDragEndInHandle(this, evt)\n    })\n    m.isEpiMorph = true;\n    return m\n}","funcProperties":{"__isSmartRef__":true,"id":58},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"57":{"this":{"__isSmartRef__":true,"id":0}},"58":{"timestamp":{"__isSmartRef__":true,"id":59},"user":"jenslincke","tags":[]},"59":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:08:29 GMT+0100 (CET)"},"60":{"varMapping":{"__isSmartRef__":true,"id":61},"source":"function showFromHandle() {\n    if (!this.fromHandle) {\n        this.fromHandle = this.makeHandle();\n        this.fromHandle.setFill(Color.red)\n        this.fromHandle.isFromHandle = true;\n    }\n    this.fromHandle.openInWorld();\n    this.fromHandle.controlPoint = this.controlPoints[0];\n    this.fromHandle.setPosition(this.controlPoints[0].getGlobalPos().subPt(pt(5,5)))\n    return this.fromHandle\n}","funcProperties":{"__isSmartRef__":true,"id":62},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"61":{"this":{"__isSmartRef__":true,"id":0}},"62":{"timestamp":{"__isSmartRef__":true,"id":63},"user":"jenslincke","tags":[]},"63":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:13:03 GMT+0100 (CET)"},"64":{"varMapping":{"__isSmartRef__":true,"id":65},"source":"function showToHandle() {\n    if (!this.toHandle) {\n        this.toHandle = this.makeHandle();\n        this.toHandle.setFill(Color.red)\n        this.toHandle.isToHandle = true;\n\n    }\n    this.toHandle.openInWorld();\n    this.toHandle.controlPoint = this.controlPoints[1];\n    this.toHandle.setPosition(this.controlPoints[1].getGlobalPos().subPt(pt(5,5)))\n    return this.toHandle\n}","funcProperties":{"__isSmartRef__":true,"id":66},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"65":{"this":{"__isSmartRef__":true,"id":0}},"66":{"timestamp":{"__isSmartRef__":true,"id":67},"user":"jenslincke","tags":[]},"67":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:20:25 GMT+0100 (CET)"},"68":{"varMapping":{"__isSmartRef__":true,"id":69},"source":"function reset() {\n    if (this.fromHandle) {\n        this.fromHandle.remove()\n        delete this.fromHandle\n    }\n    if (this.toHandle) {\n        this.toHandle.remove()\n        delete this.toHandle\n    }\n    // this.controlPoints[1].setPos(pt(200,200))\n}","funcProperties":{"__isSmartRef__":true,"id":70},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"69":{"this":{"__isSmartRef__":true,"id":0}},"70":{"timestamp":{"__isSmartRef__":true,"id":71},"user":"jenslincke","tags":[]},"71":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:15:00 GMT+0100 (CET)"},"72":{"varMapping":{"__isSmartRef__":true,"id":73},"source":"function onDragInHandle(handle, evt) {\n\n    var pos = handle.getPositionInWorld();\n    var delta = evt.hand.getPosition().subPt(pos);\n    handle.moveBy(delta)\n    pos = handle.getPositionInWorld();\n    if (handle.controlPoint)\n        handle.controlPoint.setGlobalPos(pos.addPt(pt(5,5)))\n    var morphs = this.owner.morphsContainingPoint(pos)\n    morphs = morphs.reject(function(ea) {\n        return ea.isWorld || (ea === handle) || (ea === this) || \n            (ea === this.owner)\n    }, this)\n    if (this.selectedMorphHighlights) \n        this.selectedMorphHighlights.invoke('remove')\n    this.selectedMorph = morphs.first();\n    this.selectedMorphHighlights = show(this.selectedMorph)\n    handle.startPos = evt.getPosition();\n}","funcProperties":{"__isSmartRef__":true,"id":74},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"73":{"this":{"__isSmartRef__":true,"id":0}},"74":{"timestamp":{"__isSmartRef__":true,"id":75},"user":"jenslincke","tags":[]},"75":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:06:40 GMT+0100 (CET)"},"76":{"varMapping":{"__isSmartRef__":true,"id":77},"source":"function onDragStartInHandle(handle, evt) {\n    handle.startPos = evt.getPosition()\n}","funcProperties":{"__isSmartRef__":true,"id":78},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"77":{"this":{"__isSmartRef__":true,"id":0}},"78":{"timestamp":{"__isSmartRef__":true,"id":79},"user":"jenslincke","tags":[]},"79":{"isSerializedDate":true,"string":"Thu Dec 13 2012 15:51:13 GMT+0100 (CET)"},"80":{"varMapping":{"__isSmartRef__":true,"id":81},"source":"function onDragEndInHandle(handle, evt) {\n    if (this.selectedMorphHighlights) \n        this.selectedMorphHighlights.invoke('remove')\n    \n    if (handle.isFromHandle) this.connectFrom(this.selectedMorph)\n    if (handle.isToHandle) this.connectTo(this.selectedMorph)\n    handle.remove()\n    this.updatePosition()\n}","funcProperties":{"__isSmartRef__":true,"id":82},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"81":{"this":{"__isSmartRef__":true,"id":0}},"82":{"timestamp":{"__isSmartRef__":true,"id":83},"user":"jenslincke","tags":[]},"83":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:36:59 GMT+0100 (CET)"},"84":{"varMapping":{"__isSmartRef__":true,"id":85},"source":"function connectFrom(morph) {\n    if (morph && morph === this.toMorph) return; // not allowed\n\n    this.disconnectMorph(this.fromMorph)\n    this.fromMorph = morph;\n    this.connectMorph(this.fromMorph)\n}","funcProperties":{"__isSmartRef__":true,"id":86},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"85":{"this":{"__isSmartRef__":true,"id":0}},"86":{"timestamp":{"__isSmartRef__":true,"id":87},"user":"jenslincke","tags":[]},"87":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:02:22 GMT+0100 (CET)"},"88":{"varMapping":{"__isSmartRef__":true,"id":89},"source":"function connectTo(morph) {\n\n    if (morph && morph === this.fromMorph) return; // not allowed\n\n    this.disconnectMorph(this.toMorph)\n    this.toMorph = morph;\n    this.connectMorph(this.toMorph)\n}","funcProperties":{"__isSmartRef__":true,"id":90},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"89":{"this":{"__isSmartRef__":true,"id":0}},"90":{"timestamp":{"__isSmartRef__":true,"id":91},"user":"jenslincke","tags":[]},"91":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:02:30 GMT+0100 (CET)"},"92":{"varMapping":{"__isSmartRef__":true,"id":93},"source":"function hideToHandle() {\n    if (this.toHandle) {\n        this.toHandle.remove();\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":94},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"93":{"this":{"__isSmartRef__":true,"id":0}},"94":{"timestamp":{"__isSmartRef__":true,"id":95},"user":"jenslincke","tags":[]},"95":{"isSerializedDate":true,"string":"Thu Dec 13 2012 16:51:59 GMT+0100 (CET)"},"96":{"varMapping":{"__isSmartRef__":true,"id":97},"source":"function hideFromHandle() {\n    if (this.fromHandle) {\n        this.fromHandle.remove();\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":98},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"97":{"this":{"__isSmartRef__":true,"id":0}},"98":{"timestamp":{"__isSmartRef__":true,"id":99},"user":"jenslincke","tags":[]},"99":{"isSerializedDate":true,"string":"Thu Dec 13 2012 16:52:18 GMT+0100 (CET)"},"100":{"varMapping":{"__isSmartRef__":true,"id":101},"source":"function updateIntersection(morph, cp) {\n    if (!morph) return;\n    var intersection =  this.intersectMorph(morph)[0];\n    if (intersection) {\n        cp.setGlobalPos(intersection);\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":102},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"101":{"this":{"__isSmartRef__":true,"id":0}},"102":{"timestamp":{"__isSmartRef__":true,"id":103},"user":"jenslincke","tags":[]},"103":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:51:32 GMT+0100 (CET)"},"104":{"varMapping":{"__isSmartRef__":true,"id":105},"source":"function lineIntersect(a1, a2, b1, b2){\n    // inspired by http://stackoverflow.com/questions/3746274/line-intersection-with-aabb-rectangle\n    var b = a2.subPt(a1);\n    var d = b2.subPt(b1);\n    var bDotDPerp = b.x * d.y - b.y * d.x;\n\n    // if b dot d == 0, it means the lines are parallel so have infinite intersection points\n    if (bDotDPerp == 0)\n        return null;\n\n    var c = b1.subPt(a1);\n    var t = (c.x * d.y - c.y * d.x) / bDotDPerp;\n    if (t < 0 || t > 1)\n        return null;\n\n    var u = (c.x * b.y - c.y * b.x) / bDotDPerp;\n    if (u < 0 || u > 1)\n        return null;\n\n    return a1.addPt(b.scaleBy(t));\n}","funcProperties":{"__isSmartRef__":true,"id":106},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"105":{"this":{"__isSmartRef__":true,"id":0}},"106":{"timestamp":{"__isSmartRef__":true,"id":107},"user":"jenslincke","tags":[]},"107":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:47:12 GMT+0100 (CET)"},"108":{"varMapping":{"__isSmartRef__":true,"id":109},"source":"function intersectMorphLinePoints(morph, a1, a2) {\n    var points = this.globalShapePathFromMorph(morph);\n    var intersections = [];\n    points.inject(points.last(), function(last, ea) {\n        var p = this.lineIntersect(a1, a2, last, ea)\n        if (p) intersections.push(p)\n        return ea\n    }, this)\n    return intersections\n}","funcProperties":{"__isSmartRef__":true,"id":110},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"109":{"this":{"__isSmartRef__":true,"id":0}},"110":{"timestamp":{"__isSmartRef__":true,"id":111},"user":"jenslincke","tags":[]},"111":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:53:21 GMT+0100 (CET)"},"112":{"varMapping":{"__isSmartRef__":true,"id":113},"source":"function intersectMorph(morph) {\n    var line = this;\n    return this.intersectMorphLinePoints(morph,\n        line.controlPoints[0].getGlobalPos(), line.controlPoints[1].getGlobalPos())\n}","funcProperties":{"__isSmartRef__":true,"id":114},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"113":{"this":{"__isSmartRef__":true,"id":0}},"114":{"timestamp":{"__isSmartRef__":true,"id":115},"user":"jenslincke","tags":[]},"115":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:51:47 GMT+0100 (CET)"},"116":{"varMapping":{"__isSmartRef__":true,"id":117},"source":"function globalShapePathFromMorph(morph) {\n    var b = morph.shape.bounds();\n    var p1 = morph.worldPoint(b.topLeft()),\n        p2 = morph.worldPoint(b.topRight()),\n        p3 = morph.worldPoint(b.bottomRight()),\n        p4 = morph.worldPoint(b.bottomLeft());\n    return [p1, p2, p3, p4]\n}","funcProperties":{"__isSmartRef__":true,"id":118},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"117":{"this":{"__isSmartRef__":true,"id":0}},"118":{"timestamp":{"__isSmartRef__":true,"id":119},"user":"jenslincke","tags":[]},"119":{"isSerializedDate":true,"string":"Thu Dec 13 2012 17:53:00 GMT+0100 (CET)"},"120":{"varMapping":{"__isSmartRef__":true,"id":121},"source":"function remove() {\n    \n    this.disconnectMorph(this.fromMorph)\n    this.disconnectMorph(this.toMorph)\n    return $super()\n}","funcProperties":{"__isSmartRef__":true,"id":126},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"121":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":122}},"122":{"$super":{"__isSmartRef__":true,"id":123}},"123":{"varMapping":{"__isSmartRef__":true,"id":124},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":125},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"124":{"obj":{"__isSmartRef__":true,"id":0},"name":"remove"},"125":{},"126":{"timestamp":{"__isSmartRef__":true,"id":127},"user":"jenslincke","tags":[]},"127":{"isSerializedDate":true,"string":"Thu Dec 13 2012 18:33:57 GMT+0100 (CET)"},"isSimplifiedRegistry":true}}