@@ -46,10 +46,8 @@ pub fn ui_stack_system(
46
46
) ;
47
47
}
48
48
49
- * ui_stack = UiStack {
50
- uinodes : Vec :: < Entity > :: with_capacity ( total_entry_count) ,
51
- } ;
52
-
49
+ ui_stack. uinodes . clear ( ) ;
50
+ ui_stack. uinodes . reserve ( total_entry_count) ;
53
51
fill_stack_recursively ( & mut ui_stack. uinodes , & mut global_context) ;
54
52
}
55
53
@@ -141,46 +139,46 @@ mod tests {
141
139
142
140
let mut queue = CommandQueue :: default ( ) ;
143
141
let mut commands = Commands :: new ( & mut queue, & world) ;
144
- commands. spawn_bundle ( node_with_zindex ( "0" , ZIndex :: Global ( 2 ) ) ) ;
142
+ commands. spawn ( node_with_zindex ( "0" , ZIndex :: Global ( 2 ) ) ) ;
145
143
146
144
commands
147
- . spawn_bundle ( node_with_zindex ( "1" , ZIndex :: Local ( 1 ) ) )
145
+ . spawn ( node_with_zindex ( "1" , ZIndex :: Local ( 1 ) ) )
148
146
. with_children ( |parent| {
149
147
parent
150
- . spawn_bundle ( node_without_zindex ( "1-0" ) )
148
+ . spawn ( node_without_zindex ( "1-0" ) )
151
149
. with_children ( |parent| {
152
- parent. spawn_bundle ( node_without_zindex ( "1-0-0" ) ) ;
153
- parent. spawn_bundle ( node_without_zindex ( "1-0-1" ) ) ;
154
- parent. spawn_bundle ( node_with_zindex ( "1-0-2" , ZIndex :: Local ( -1 ) ) ) ;
150
+ parent. spawn ( node_without_zindex ( "1-0-0" ) ) ;
151
+ parent. spawn ( node_without_zindex ( "1-0-1" ) ) ;
152
+ parent. spawn ( node_with_zindex ( "1-0-2" , ZIndex :: Local ( -1 ) ) ) ;
155
153
} ) ;
156
- parent. spawn_bundle ( node_without_zindex ( "1-1" ) ) ;
154
+ parent. spawn ( node_without_zindex ( "1-1" ) ) ;
157
155
parent
158
- . spawn_bundle ( node_with_zindex ( "1-2" , ZIndex :: Global ( -1 ) ) )
156
+ . spawn ( node_with_zindex ( "1-2" , ZIndex :: Global ( -1 ) ) )
159
157
. with_children ( |parent| {
160
- parent. spawn_bundle ( node_without_zindex ( "1-2-0" ) ) ;
161
- parent. spawn_bundle ( node_with_zindex ( "1-2-1" , ZIndex :: Global ( -3 ) ) ) ;
158
+ parent. spawn ( node_without_zindex ( "1-2-0" ) ) ;
159
+ parent. spawn ( node_with_zindex ( "1-2-1" , ZIndex :: Global ( -3 ) ) ) ;
162
160
parent
163
- . spawn_bundle ( node_without_zindex ( "1-2-2" ) )
161
+ . spawn ( node_without_zindex ( "1-2-2" ) )
164
162
. with_children ( |_| ( ) ) ;
165
- parent. spawn_bundle ( node_without_zindex ( "1-2-3" ) ) ;
163
+ parent. spawn ( node_without_zindex ( "1-2-3" ) ) ;
166
164
} ) ;
167
- parent. spawn_bundle ( node_without_zindex ( "1-3" ) ) ;
165
+ parent. spawn ( node_without_zindex ( "1-3" ) ) ;
168
166
} ) ;
169
167
170
168
commands
171
- . spawn_bundle ( node_without_zindex ( "2" ) )
169
+ . spawn ( node_without_zindex ( "2" ) )
172
170
. with_children ( |parent| {
173
171
parent
174
- . spawn_bundle ( node_without_zindex ( "2-0" ) )
172
+ . spawn ( node_without_zindex ( "2-0" ) )
175
173
. with_children ( |_parent| ( ) ) ;
176
174
parent
177
- . spawn_bundle ( node_without_zindex ( "2-1" ) )
175
+ . spawn ( node_without_zindex ( "2-1" ) )
178
176
. with_children ( |parent| {
179
- parent. spawn_bundle ( node_without_zindex ( "2-1-0" ) ) ;
177
+ parent. spawn ( node_without_zindex ( "2-1-0" ) ) ;
180
178
} ) ;
181
179
} ) ;
182
180
183
- commands. spawn_bundle ( node_with_zindex ( "3" , ZIndex :: Global ( -2 ) ) ) ;
181
+ commands. spawn ( node_with_zindex ( "3" , ZIndex :: Global ( -2 ) ) ) ;
184
182
185
183
queue. apply ( & mut world) ;
186
184
0 commit comments