Fix tests

This commit is contained in:
Aevyrie Roessler 2025-02-28 17:18:58 -08:00
parent 4e006a48e3
commit c7eb5c653e
2 changed files with 9 additions and 11 deletions

View File

@ -9,7 +9,7 @@ pub use serial::propagate_parent_transforms;
/// Update [`GlobalTransform`] component of entities that aren't in the hierarchy
///
/// Third party plugins should ensure that this is used in concert with
/// [`propagate_parent_transforms`] and [`compute_transform_leaves`].
/// [`propagate_parent_transforms`] and [`mark_dirty_trees`].
pub fn sync_simple_transforms(
mut query: ParamSet<(
Query<
@ -57,11 +57,12 @@ pub fn mark_dirty_trees(
while let Ok((parent, mut tree)) = transforms.get_mut(next) {
if tree.is_changed() {
break; // Tree has already been processed
} else {
tree.set_changed();
}
tree.set_changed();
if let Some(parent) = parent.map(ChildOf::get) {
next = parent;
} else {
break;
};
}
}
@ -409,12 +410,8 @@ mod parallel {
}
}
/// Propagate transforms from `parent` to its non-leaf `children`, pushing updated child
/// entities to the `outbox`. Propagation does not visit leaf nodes; instead, they are computed
/// in [`compute_transform_leaves`](super::compute_transform_leaves), which can optimize much
/// more efficiently.
///
/// This function will continue propagating transforms to descendants in a depth-first
/// Propagate transforms from `parent` to its `children`, pushing updated child entities to the
/// `outbox`. This function will continue propagating transforms to descendants in a depth-first
/// traversal, while simultaneously pushing unvisited branches to the outbox, for other threads
/// to take when idle.
///

View File

@ -353,9 +353,10 @@ mod tests {
use bevy_math::{Rect, UVec2, Vec2};
use bevy_platform_support::collections::HashMap;
use bevy_render::{camera::ManualTextureViews, prelude::Camera};
use bevy_transform::systems::mark_dirty_trees;
use bevy_transform::{
prelude::GlobalTransform,
systems::{compute_transform_leaves, propagate_parent_transforms, sync_simple_transforms},
systems::{propagate_parent_transforms, sync_simple_transforms},
};
use bevy_utils::prelude::default;
use bevy_window::{
@ -408,9 +409,9 @@ mod tests {
update_ui_context_system,
ApplyDeferred,
ui_layout_system,
mark_dirty_trees,
sync_simple_transforms,
propagate_parent_transforms,
compute_transform_leaves,
)
.chain(),
);