Add workspace/z property to nodes

This commit is contained in:
Nicholas O'Leary
2013-10-20 23:11:38 +01:00
parent fa8dcdc87f
commit 31a3d1e91b
2 changed files with 24 additions and 6 deletions

View File

@@ -120,7 +120,8 @@ RED.nodes = function() {
if (n._def.category != "config") {
node.x = n.x;
node.y = n.y;
node.z = n.z;
node.wires = [];
for(var i=0;i<n.outputs;i++) {
node.wires.push([]);
@@ -218,7 +219,10 @@ RED.nodes = function() {
RED.nodes.add(configNode);
}
} else {
var node = {x:n.x,y:n.y,type:0,wires:n.wires};
if (n.z == null) {
n.z = 0;
}
var node = {x:n.x,y:n.y,z:n.z,type:0,wires:n.wires};
if (createNewIds) {
node.id = (1+Math.random()*4294967295).toString(16);
} else {