# HG changeset patch # User Thinker K.F. Li # Date 1285433596 -28800 # Node ID 6c8e4e1f3a39699624a9e6e202b11ca9c4cc2ee8 # Parent 47a8086e77295918036d2b40141ca1fdfa117d62 Maintain a list of children diff -r 47a8086e7729 -r 6c8e4e1f3a39 nodejs/mbapp.js --- a/nodejs/mbapp.js Sat Sep 25 22:04:23 2010 +0800 +++ b/nodejs/mbapp.js Sun Sep 26 00:53:16 2010 +0800 @@ -42,6 +42,7 @@ coord = this._mbapp_saved_coord_new(parent); coord.type = "coord"; + coord.children = []; coord._mbapp_saved_mtx = [coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]]; coord._mbapp_saved_rev_mtx = _reverse(coord._mbapp_saved_mtx); @@ -52,7 +53,10 @@ this._mbapp_saved_add_shape(shape); shape.parent = this; + this.children.push(shape); } + + parent.children.push(coord); return coord; }; @@ -62,6 +66,7 @@ */ coord = mb_rt.root; coord.type = "coord"; + coord.children = []; coord._mbapp_saved_mtx = [coord[0], coord[1], coord[2], coord[3], coord[4], coord[5]]; coord._mbapp_saved_rev_mtx = _reverse(coord._mbapp_saved_mtx);