From 8d2500fc3db197e13ee5cb018f701c0fdfe5b293 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Fri, 11 Jul 2025 15:36:13 +0100 Subject: [PATCH] set taffy style scrollbar_width from the new Node field --- crates/bevy_ui/src/layout/convert.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/layout/convert.rs b/crates/bevy_ui/src/layout/convert.rs index 53c03113b9..22c6c14aa4 100644 --- a/crates/bevy_ui/src/layout/convert.rs +++ b/crates/bevy_ui/src/layout/convert.rs @@ -73,7 +73,7 @@ pub fn from_node(node: &Node, context: &LayoutContext, ignore_border: bool) -> t x: node.overflow.x.into(), y: node.overflow.y.into(), }, - scrollbar_width: 0.0, + scrollbar_width: node.scrollbar_width, position: node.position_type.into(), flex_direction: node.flex_direction.into(), flex_wrap: node.flex_wrap.into(), @@ -503,6 +503,7 @@ mod tests { aspect_ratio: None, overflow: crate::Overflow::clip(), overflow_clip_margin: crate::OverflowClipMargin::default(), + scrollbar_width: 7., column_gap: Val::ZERO, row_gap: Val::ZERO, grid_auto_flow: GridAutoFlow::ColumnDense, @@ -624,6 +625,7 @@ mod tests { assert_eq!(taffy_style.max_size.width, taffy::style::Dimension::Auto); assert_eq!(taffy_style.max_size.height, taffy::style::Dimension::ZERO); assert_eq!(taffy_style.aspect_ratio, None); + assert_eq!(taffy_style.scrollbar_width, 7.); assert_eq!(taffy_style.gap.width, taffy::style::LengthPercentage::ZERO); assert_eq!(taffy_style.gap.height, taffy::style::LengthPercentage::ZERO); assert_eq!(