From eb6c93fb558e843d5a371590cf6697f0aeefb4d1 Mon Sep 17 00:00:00 2001 From: funman300 Date: Sun, 17 May 2026 22:43:59 -0700 Subject: [PATCH] fix(engine): silence B0004 by adding Transform to ModalScrim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ModalCard carries Transform (for its 0.96→1.0 scale entrance animation), which auto-inserts GlobalTransform. Bevy 0.18's on_insert hook on GlobalTransform fires B0004 when the child has GlobalTransform but the parent does not. ModalScrim had only Node (which gives InheritedVisibility via UiTransform but not GlobalTransform), so every modal spawn triggered the warning. Adding Transform::default() to ModalScrim gives it GlobalTransform and satisfies the hook. UI layout is unaffected because Bevy's layout pipeline reads UiTransform, not Transform. Co-Authored-By: Claude Sonnet 4.6 --- solitaire_engine/src/ui_modal.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/solitaire_engine/src/ui_modal.rs b/solitaire_engine/src/ui_modal.rs index d0cdd7d..5dd80c5 100644 --- a/solitaire_engine/src/ui_modal.rs +++ b/solitaire_engine/src/ui_modal.rs @@ -212,6 +212,13 @@ where // modal at `Z_PAUSE` (220) in some scenes. GlobalZIndex(z_panel), ZIndex(z_panel), + // B0004: ModalCard carries Transform (for the scale animation). + // Bevy's GlobalTransform hook fires B0004 when a child has + // GlobalTransform but the parent does not. Adding Identity + // Transform here gives the scrim GlobalTransform so the check + // passes. UI layout still uses UiTransform; this has no layout + // effect. + Transform::default(), )) .with_children(|root| { root.spawn((