From 22489f50da5a258b85a517e8d30a4949084b4bda Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 14 Jul 2026 15:00:05 +0800 Subject: [PATCH] fix: group conflicting Transform queries in ParamSet to fix B0001 panic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resize_offscreen declared two Query<&mut Transform> params (FullscreenQuad and UpscaleQuad filters). Bevy's conflict checker does not treat With filters as disjoint access — both queries declare write access to the same component, so the app panicked at startup with error[B0001]. Merge the two queries into a ParamSet (borrowed one at a time) and move them to the end of the parameter list per the Params convention. --- src/render/plugin.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/render/plugin.rs b/src/render/plugin.rs index bbf12f2..f4f83cf 100644 --- a/src/render/plugin.rs +++ b/src/render/plugin.rs @@ -145,10 +145,15 @@ fn resize_offscreen( mut images: ResMut>, params: Res, target: Query<&OffscreenTarget>, - mut bh_quad: Query<&mut Transform, With>, - mut up_quad: Query<&mut Transform, With>, window: Query<&Window>, mut resized: MessageReader, + // Both queries borrow `&mut Transform`. Bevy's conflict checker does not + // treat `With` filters as disjoint access, so two such Query params would + // trip B0001 — they must be grouped in a ParamSet (borrowed one at a time). + mut quads: ParamSet<( + Query<&mut Transform, With>, + Query<&mut Transform, With>, + )>, ) { if resized.read().next().is_none() { return; @@ -164,10 +169,10 @@ fn resize_offscreen( // insert is harmless — it'll succeed on the next WindowResized. let _ = images.insert(handle.0.id(), img); } - for mut t in &mut bh_quad { + for mut t in &mut quads.p0() { t.scale = Vec3::new(w as f32 / 2.0, h as f32 / 2.0, 1.0); } - for mut t in &mut up_quad { + for mut t in &mut quads.p1() { t.scale = Vec3::new(win.width() / 2.0, win.height() / 2.0, 1.0); } }