changeset 884:6c8e4e1f3a39 abs_n_rel_center

Maintain a list of children
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 26 Sep 2010 00:53:16 +0800
parents 47a8086e7729
children 2b492008ce26
files nodejs/mbapp.js
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);