diff --git a/arbor_src/physics/physics.js b/arbor_src/physics/physics.js index a3b2d563..b0fe580a 100644 --- a/arbor_src/physics/physics.js +++ b/arbor_src/physics/physics.js @@ -317,7 +317,6 @@ var topleft = null $.each(active.particles, function(i, point) { - // move the node to its new position if (that.integrator=='euler'){ point.p = point.p.add(point.v.multiply(timestep)); diff --git a/arbor_src/physics/system.js b/arbor_src/physics/system.js index 3ce52ee1..5626f0af 100644 --- a/arbor_src/physics/system.js +++ b/arbor_src/physics/system.js @@ -102,10 +102,9 @@ state.names[name] = node state.nodes[node._id] = node; - _changes.push({t:"addNode", id:node._id, m:node.mass, x:x, y:y, f:fixed}) + _changes.push({t:"addNode", id:node._id, m:node.mass, x:x, y:y, f:fixed}); that._notify(); return node; - } }, @@ -618,4 +617,4 @@ return that } - \ No newline at end of file + diff --git a/src/git.js b/src/git.js index a43012a9..9b9dd410 100644 --- a/src/git.js +++ b/src/git.js @@ -33,17 +33,23 @@ GitEngine.prototype.getClosuresForCommand = function(command) { var Commit = Backbone.Model.extend({ initialize: function() { // validation / defaults - if (!this.get('name')) { - this.set('name', _.uniqueId('C')); + if (!this.get('id')) { + this.set('id', _.uniqueId('C')); } - if (!this.get('parent') && !this.get('rootCommit')) { + if (!this.get('parentCommit') && !this.get('rootCommit')) { throw new Error('needs parent commit'); } - // make a node and start drawing? this is a major TODO - }, - draw: function() { + this.set('node', sys.addNode(this.get('id'))); + if (this.get('rootCommit')) { + // TODO + // this.get('node').fixed = true; + // this.get('node').p = {x: 0, y: 0}; + } else { + var parentNode = this.get('parentCommit').get('node'); + sys.addEdge(parentNode, this.get('node')); + } } });