fix(engine): silence B0004 by adding Transform to ModalScrim
Build and Deploy / build-and-push (push) Successful in 3m51s
Build and Deploy / build-and-push (push) Successful in 3m51s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -212,6 +212,13 @@ where
|
|||||||
// modal at `Z_PAUSE` (220) in some scenes.
|
// modal at `Z_PAUSE` (220) in some scenes.
|
||||||
GlobalZIndex(z_panel),
|
GlobalZIndex(z_panel),
|
||||||
ZIndex(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| {
|
.with_children(|root| {
|
||||||
root.spawn((
|
root.spawn((
|
||||||
|
|||||||
Reference in New Issue
Block a user