|
|
@ -29,9 +29,9 @@ class SpringSolver { |
|
|
|
if (this.body.nodes[edge.toId] !== undefined && this.body.nodes[edge.fromId] !== undefined) { |
|
|
|
if (edge.edgeType.via !== undefined) { |
|
|
|
edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length; |
|
|
|
node1 = nodes[edge.to.id]; |
|
|
|
node1 = nodes[edge.toId]; |
|
|
|
node2 = nodes[edge.edgeType.via.id]; |
|
|
|
node3 = nodes[edge.from.id]; |
|
|
|
node3 = nodes[edge.fromId]; |
|
|
|
|
|
|
|
this._calculateSpringForce(node1, node2, 0.5 * edgeLength); |
|
|
|
this._calculateSpringForce(node2, node3, 0.5 * edgeLength); |
|
|
@ -40,7 +40,7 @@ class SpringSolver { |
|
|
|
// the * 1.5 is here so the edge looks as large as a smooth edge. It does not initially because the smooth edges use
|
|
|
|
// the support nodes which exert a repulsive force on the to and from nodes, making the edge appear larger.
|
|
|
|
edgeLength = edge.options.length === undefined ? this.options.springLength * 1.5: edge.options.length; |
|
|
|
this._calculateSpringForce(nodes[edge.from.id], nodes[edge.to.id], edgeLength); |
|
|
|
this._calculateSpringForce(nodes[edge.fromId], nodes[edge.toId], edgeLength); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|