Compare commits

..

No commits in common. "6e1c170ff69c51d86c00a7390b8b7fad9f569c4a" and "0c5a1142d39edbb8807c18efec256bb6228974e0" have entirely different histories.

View File

@ -240,20 +240,29 @@ var Pivot =
{ {
// collect modifiers effecting leaves // collect modifiers effecting leaves
let modifiers = []; let modifiers = [];
let collectModifier = n => modifiers.push(n); let check = N.Step(inLeaf, "ModifyAt", false);
let connectModifiers = n => modifiers.forEach(inModifier => N.Connect(inModifier, n, "ModifyOut", true)); if(check)
{
N.Walk(collectModifier, inLeaf, "ModifyAt", false); modifiers = modifiers.concat(check);
N.Walk(collectModifier, inLeaf, "ModifyDown", false); }
check = N.Step(inLeaf, "ModifyDown", false);
if(check)
{
modifiers = modifiers.concat(check);
}
if(modifiers.length) if(modifiers.length)
{ {
// apply them to the branch // apply them to the branch
inLastBranch.ID.Walk = N.ID.Walk; inLastBranch.ID.Walk = N.ID.Walk;
connectModifiers(inLastBranch); modifiers.forEach( inModifier => N.Connect(inModifier, inLastBranch, "ModifyOut") )
// also walk them up and connect, but with "check unique" enabled // also walk them up and connect, but with "check unique" enabled
N.Walk(connectModifiers, inLastBranch, "Hierarchy", false); N.Walk( inNode=>
{
modifiers.forEach( inModifier => N.Connect(inModifier, inNode, "ModifyOut", true) )
}
, inLastBranch, "Hierarchy", false);
} }
// lastly connect the leaf to the branch // lastly connect the leaf to the branch
@ -266,7 +275,7 @@ var Pivot =
{ {
iterator = child => Pivot.Pivot(inRoot, child, inPivotIndicies, inSumIndicies, depth+1); iterator = child => Pivot.Pivot(inRoot, child, inPivotIndicies, inSumIndicies, depth+1);
} }
N.Walk(iterator, inParent, "Hierarchy"); N.Step(inParent, "Hierarchy").forEach(iterator);
return inParent; return inParent;
}, },
Create(inPivotIndicies, inSumIndicies) Create(inPivotIndicies, inSumIndicies)
@ -295,13 +304,13 @@ var Pivot =
} }
} }
// disconnect leaves from terminal branches // disconnect terminal branches
N.Walk(()=>{}, inRoot, "Hierarchy", true, terminal=>{ N.Walk(()=>{}, inRoot, "Hierarchy", inNode=>{
N.Disconnect(terminal, null, "Leaf"); N.Disconnect(inNode, null, "Leaf");
}); });
// disconnect from app // disconnect from app
N.Disconnect(null, inRoot, "Pivot"); N.Disconnect(null, inRoot, "Pivot")
}, },
Modify(inNode) Modify(inNode)
{ {