moveNode method

void moveNode(
  1. int instanceId,
  2. int nodeId,
  3. int pId,
  4. int index,
)

用于同父节点下移动子节点

Implementation

void moveNode(
  int instanceId,
  int nodeId,
  int pId,
  int index,
) {
  var parentNode = controllerManager.findNode(instanceId, pId);
  var renderNode = controllerManager.findNode(instanceId, nodeId);
  if (parentNode != null && renderNode != null) {
    parentNode.moveChild(renderNode, index);
    parentNode.move([renderNode], parentNode);
    addUpdateNodeIfNeeded(parentNode);
  }
}