@@ -116,26 +116,18 @@ fn square(i: usize) -> impl Element {
116116 . map_in ( CursorIcon :: System )
117117 . dedupe ( ) ,
118118 )
119- . with_builder ( move |builder| {
120- builder
121- . lazy_entity ( lazy_entity. clone ( ) )
122- . insert ( ( Pickable :: default ( ) , DragOffset :: default ( ) ) )
123- . observe (
124- |click : On < Pointer < Press > > ,
125- max_z_index : ResMut < MaxZIndex > ,
126- z_indices : Query < & mut GlobalZIndex > ,
127- drag_offsets : Query < & mut DragOffset > ,
128- nodes : Query < & Node > | {
129- calculate_and_set_drag_offset (
130- click. entity ,
131- click. pointer_location . position ,
132- & nodes,
133- drag_offsets,
134- ) ;
135- update_z_index ( click. entity , max_z_index, z_indices) ;
136- } ,
137- )
138- } )
119+ . lazy_entity ( lazy_entity. clone ( ) )
120+ . insert ( ( Pickable :: default ( ) , DragOffset :: default ( ) ) )
121+ . observe (
122+ |click : On < Pointer < Press > > ,
123+ max_z_index : ResMut < MaxZIndex > ,
124+ z_indices : Query < & mut GlobalZIndex > ,
125+ drag_offsets : Query < & mut DragOffset > ,
126+ nodes : Query < & Node > | {
127+ calculate_and_set_drag_offset ( click. entity , click. pointer_location . position , & nodes, drag_offsets) ;
128+ update_z_index ( click. entity , max_z_index, z_indices) ;
129+ } ,
130+ )
139131 . on_dragging (
140132 |In ( ( entity, dragging_data) ) : In < ( Entity , DraggingData ) > , mut nodes : Query < ( & mut Node , & DragOffset ) > | {
141133 if let Ok ( ( node, drag_offset) ) = nodes. get_mut ( entity) {
0 commit comments