comparison nodejs/coord.cc @ 742:24038e7a365b

Reorder instructions to invalidate coords correctly
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 25 Aug 2010 11:58:30 +0800
parents d8764f10e141
children dd1f3382d6a4
comparison
equal deleted inserted replaced
741:d8764f10e141 742:24038e7a365b
65 * 65 *
66 * \sa \ref jsgc 66 * \sa \ref jsgc
67 */ 67 */
68 static void 68 static void
69 xnjsmb_coord_invalidate_subtree(Handle<Object> self) { 69 xnjsmb_coord_invalidate_subtree(Handle<Object> self) {
70 Handle<Object> *child_hdl; 70 Persistent<Object> *child_hdl;
71 Handle<Object> *mem_hdl; 71 Persistent<Object> *mem_hdl;
72 redraw_man_t *rdman; 72 redraw_man_t *rdman;
73 coord_t *coord, *child; 73 coord_t *coord, *child;
74 shape_t *mem; 74 shape_t *mem;
75 Handle<Value> _false = Boolean::New(0); 75 Handle<Value> _false = Boolean::New(0);
76 76
79 79
80 coord = (coord_t *)UNWRAP(self); 80 coord = (coord_t *)UNWRAP(self);
81 81
82 /* Invalidate all coords in the subtree */ 82 /* Invalidate all coords in the subtree */
83 FOR_COORDS_PREORDER(coord, child) { 83 FOR_COORDS_PREORDER(coord, child) {
84 child_hdl = (Handle<Object> *)mb_prop_get(&child->obj.props, 84 child_hdl = (Persistent<Object> *)mb_prop_get(&child->obj.props,
85 PROP_JSOBJ); 85 PROP_JSOBJ);
86 child = (coord_t *)UNWRAP(*child_hdl); 86 SET(*child_hdl, "valid", _false);
87 WRAP(*child_hdl, NULL); 87 WRAP(*child_hdl, NULL);
88 SET(*child_hdl, "valid", _false);
89 88
90 /* Invalidate members of a coord */ 89 /* Invalidate members of a coord */
91 FOR_COORD_SHAPES(child, mem) { 90 FOR_COORD_SHAPES(child, mem) {
92 mem_hdl = (Handle<Object> *)mb_prop_get(&mem->obj.props, 91 mem_hdl = (Persistent<Object> *)mb_prop_get(&mem->obj.props,
93 PROP_JSOBJ); 92 PROP_JSOBJ);
93 SET(*mem_hdl, "valid", _false);
94 WRAP(*mem_hdl, NULL); 94 WRAP(*mem_hdl, NULL);
95 SET(*mem_hdl, "valid", _false);
96 } 95 }
97 } 96 }
98 } 97 }
99 98
100 static void 99 static void