From ce9d878b52e1995d9db7cb66f32949885eed93b0 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Fri, 11 Jul 2025 22:10:51 +0100 Subject: [PATCH] Renamed `scroll_offset` to `scroll_position` --- crates/bevy_ui/src/layout/mod.rs | 2 +- crates/bevy_ui/src/ui_node.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index 6c93367fb8..f587735dcd 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -333,7 +333,7 @@ with UI components as a child of an entity without UI components, your UI layout let physical_scroll_position = clamped_scroll_position.floor(); - node.bypass_change_detection().scroll_offset = physical_scroll_position; + node.bypass_change_detection().scroll_position = physical_scroll_position; for child_uinode in ui_children.iter_ui_children(entity) { update_uinode_geometry_recursive( diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index b520675eca..bda1b48bc4 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -46,10 +46,10 @@ pub struct ComputedNode { /// /// Automatically calculated by [`super::layout::ui_layout_system`]. pub scrollbar_size: Vec2, - /// Offset of scrolled content + /// Resolved offset of scrolled content /// /// Automatically calculated by [`super::layout::ui_layout_system`]. - pub scroll_offset: Vec2, + pub scroll_position: Vec2, /// The width of this node's outline. /// If this value is `Auto`, negative or `0.` then no outline will be rendered. /// Outline updates bypass change detection. @@ -314,7 +314,7 @@ impl ComputedNode { size: Vec2::ZERO, content_size: Vec2::ZERO, scrollbar_size: Vec2::ZERO, - scroll_offset: Vec2::ZERO, + scroll_position: Vec2::ZERO, outline_width: 0., outline_offset: 0., unrounded_size: Vec2::ZERO,