Added nodeSelected parameter, I think.
This commit is contained in:
parent
ed18a912fe
commit
2f3118797e
|
@ -31,6 +31,8 @@ jQuery.fn.springy = function(params) {
|
|||
var stiffness = params.stiffness || 400.0;
|
||||
var repulsion = params.repulsion || 400.0;
|
||||
var damping = params.damping || 0.5;
|
||||
|
||||
var nodeSelected = params.nodeSelected || null;
|
||||
|
||||
var canvas = this[0];
|
||||
var ctx = canvas.getContext("2d");
|
||||
|
@ -86,6 +88,9 @@ jQuery.fn.springy = function(params) {
|
|||
// Part of the same bug mentioned later. Store the previous mass
|
||||
// before upscaling it for dragging.
|
||||
dragged.point.m = 10000.0;
|
||||
|
||||
// Call the nodeSelected code passed during initialization
|
||||
nodeSelected(selected.node);
|
||||
}
|
||||
|
||||
renderer.start();
|
||||
|
|
Loading…
Reference in New Issue
Block a user