bevy/crates/bevy_hierarchy/src
BigWingBeat 61f9f8c5f6
Fix with_child not inserting Parent component (#15009)
# Objective

The `Parent` component holds a reference to the parent entity of the
entity it is inserted onto. The `with_child` function erroneously
forgets to insert this component onto the child entity that it spawns,
causing buggy behaviour when the function is used instead of the other
child-spawning functions.

## Solution

Ensure `with_child` inserts the `Parent` component, the same as all the
other child-spawning functions.

## Testing

Checked before/after with a bevy_ui layout where this patch fixed buggy
behaviour I was seeing in parent/child UI nodes.
2024-09-02 22:47:25 +00:00
..
components Minimal Bubbling Observers (#13991) 2024-07-15 13:39:41 +00:00
child_builder.rs Fix with_child not inserting Parent component (#15009) 2024-09-02 22:47:25 +00:00
events.rs
hierarchy.rs Merge BuildWorldChildren and BuildChildren traits. (#14052) 2024-07-01 14:29:39 +00:00
lib.rs Merge BuildWorldChildren and BuildChildren traits. (#14052) 2024-07-01 14:29:39 +00:00
query_extension.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
valid_parent_check_plugin.rs Fixed #14248 and other URL issues (#14276) 2024-07-11 12:01:49 +00:00