浏览代码

Live modeling demo: Initialization of model should depend on current value of 'initial' edge. We force a dependency by overwriting this edge with its current value.

Joeri Exelmans 2 年之前
父节点
当前提交
28275b2850
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/frontend/demos/demo_live.tsx

+ 2 - 0
src/frontend/demos/demo_live.tsx

@@ -347,6 +347,8 @@ export function getDemoLive() {
           model.graphState.exec(nodeCreation);
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "type", "RuntimeModel"));
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "design", runtimeStuff.modelNode!.creation));
+          // overwrite 'initial' pointer with its current value:
+          runtimeStuff.modelNode!.getDeltasForSetEdge(primitiveRegistry, "initial", runtimeStuff.initial!.creation).forEach(d => model.graphState.exec(d));
           model.graphState.exec(primitiveRegistry.newEdgeCreation(nodeCreation, "current", runtimeStuff.initial!.creation));
           return {compositeLabel: "initialize"};
         });