From da6d59df7eff869edfa381a11480d5cf1dca5d27 Mon Sep 17 00:00:00 2001 From: Aceeri Date: Mon, 11 Mar 2024 10:32:20 -0700 Subject: [PATCH] Remove resource_scope from starting context --- crates/bevy_gizmos/src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 913a46e71c186c..55fbc99f16cc06 100755 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -242,17 +242,15 @@ struct LineGizmoHandles { /// Internally this pushes the parent default context into a swap buffer. /// Gizmo contexts should be handled like a stack, so if you push a new context, /// you must pop the context before the parent context ends. -pub fn start_gizmo_context(world: &mut World) +pub fn start_gizmo_context( + mut swap: ResMut>>, + mut default: ResMut>, +) where Config: GizmoConfigGroup, Clear: 'static + Send + Sync, { - world.resource_scope( - |world: &mut World, mut swap: Mut>>| { - let mut default = world.resource_mut::>(); - default.swap(&mut *swap); - }, - ); + default.swap(&mut *swap); } /// End this gizmo clearing context.