From 05b7f60ae528a6ac3fcc5beee1b2588bdadfec11 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Mon, 28 Aug 2023 19:55:35 +0100 Subject: [PATCH] UI node bundle comment fix (#9404) # Objective Doc comment for the `global_transform` field in `NodeBundle` says: ``` /// This field is automatically managed by the UI layout system. ``` The `GlobalTransform` component is the thing being managed, not the `global_transform` field, and the `TransformPropagate` systems do the managing, not the UI layout system. --- crates/bevy_ui/src/node_bundles.rs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/crates/bevy_ui/src/node_bundles.rs b/crates/bevy_ui/src/node_bundles.rs index 84f7940fe1..f43f4642d6 100644 --- a/crates/bevy_ui/src/node_bundles.rs +++ b/crates/bevy_ui/src/node_bundles.rs @@ -36,12 +36,12 @@ pub struct NodeBundle { pub focus_policy: FocusPolicy, /// The transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically managed by the UI layout system. /// To alter the position of the `NodeBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems. /// To alter the position of the `NodeBundle`, use the properties of the [`Style`] component. pub global_transform: GlobalTransform, /// Describes the visibility properties of the node @@ -88,19 +88,18 @@ pub struct ImageBundle { pub image: UiImage, /// The size of the image in pixels /// - /// This field is set automatically + /// This component is set automatically pub image_size: UiImageSize, /// Whether this node should block interaction with lower nodes pub focus_policy: FocusPolicy, /// The transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically managed by the UI layout system. /// To alter the position of the `ImageBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// - /// This field is automatically managed by the UI layout system. - /// To alter the position of the `ImageBundle`, use the properties of the [`Style`] component. + /// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems. pub global_transform: GlobalTransform, /// Describes the visibility properties of the node pub visibility: Visibility, @@ -132,17 +131,16 @@ pub struct AtlasImageBundle { pub focus_policy: FocusPolicy, /// The size of the image in pixels /// - /// This field is set automatically + /// This component is set automatically pub image_size: UiImageSize, /// The transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically managed by the UI layout system. /// To alter the position of the `AtlasImageBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// - /// This field is automatically managed by the UI layout system. - /// To alter the position of the `AtlasImageBundle`, use the properties of the [`Style`] component. + /// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems. pub global_transform: GlobalTransform, /// Describes the visibility properties of the node pub visibility: Visibility, @@ -173,13 +171,12 @@ pub struct TextBundle { pub focus_policy: FocusPolicy, /// The transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically managed by the UI layout system. /// To alter the position of the `TextBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// - /// This field is automatically managed by the UI layout system. - /// To alter the position of the `TextBundle`, use the properties of the [`Style`] component. + /// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems. pub global_transform: GlobalTransform, /// Describes the visibility properties of the node pub visibility: Visibility, @@ -285,13 +282,12 @@ pub struct ButtonBundle { pub image: UiImage, /// The transform of the node /// - /// This field is automatically managed by the UI layout system. + /// This component is automatically managed by the UI layout system. /// To alter the position of the `ButtonBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// - /// This field is automatically managed by the UI layout system. - /// To alter the position of the `ButtonBundle`, use the properties of the [`Style`] component. + /// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems. pub global_transform: GlobalTransform, /// Describes the visibility properties of the node pub visibility: Visibility,