typegraph/scripts/blocks/layoutCluster.gml

28 lines
694 B
Plaintext
Raw Permalink Normal View History

///layoutCluster(block)
/**
* layoutCluster :: Block -> ()
*
* Performs layout() for all blocks in a cluster.
*
* @param block a block within the cluster
*/
var blocks = getBlockCluster(argument0);
for (var block = ds_set_first(blocks); ds_set_exists(blocks, block); block = ds_set_next(blocks, block))
with (block) {
for (var i = 0; i < ds_list_size(children); i++)
if (instanceof(children[|i], Anchor)) {
var typeInst = children[|i].children[|0];
removeChild(children[|i], typeInst);
delete(typeInst);
addChild(children[|i], createTypeInstance(children[|i].currentType.to[|0]));
}
layout(id);
}
ds_set_destroy(blocks);