From ad0048294121c7dd48b05d982c4253699b9dd977 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sat, 8 Nov 2025 01:23:21 +0000 Subject: [PATCH 01/10] * Remove the `Component` derive from `BorderRadius`. * Instead add a `border_radius: BorderRadius` field to `Node`. --- crates/bevy_ui/src/layout/convert.rs | 3 ++ crates/bevy_ui/src/layout/mod.rs | 21 +++++-------- crates/bevy_ui/src/ui_node.rs | 45 ++++++++++++++++++++++++++-- examples/ui/borders.rs | 14 ++++----- 4 files changed, 60 insertions(+), 23 deletions(-) diff --git a/crates/bevy_ui/src/layout/convert.rs b/crates/bevy_ui/src/layout/convert.rs index c5ed6b6aa332c..bca20d9ed05ff 100644 --- a/crates/bevy_ui/src/layout/convert.rs +++ b/crates/bevy_ui/src/layout/convert.rs @@ -448,6 +448,8 @@ impl RepeatedGridTrack { mod tests { use bevy_math::Vec2; + use crate::BorderRadius; + use super::*; #[test] @@ -489,6 +491,7 @@ mod tests { top: Val::Auto, bottom: Val::Percent(31.), }, + border_radius: BorderRadius::DEFAULT, flex_grow: 1., flex_shrink: 0., flex_basis: Val::ZERO, diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index 1cb05cc495937..f4a814cc257c8 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -1,8 +1,8 @@ use crate::{ experimental::{UiChildren, UiRootNodes}, ui_transform::{UiGlobalTransform, UiTransform}, - BorderRadius, ComputedNode, ComputedUiRenderTargetInfo, ContentSize, Display, IgnoreScroll, - LayoutConfig, Node, Outline, OverflowAxis, ScrollPosition, + ComputedNode, ComputedUiRenderTargetInfo, ContentSize, Display, IgnoreScroll, LayoutConfig, + Node, Outline, OverflowAxis, ScrollPosition, }; use bevy_ecs::{ change_detection::{DetectChanges, DetectChangesMut}, @@ -87,7 +87,6 @@ pub fn ui_layout_system( &mut UiGlobalTransform, &Node, Option<&LayoutConfig>, - Option<&BorderRadius>, Option<&Outline>, Option<&ScrollPosition>, Option<&IgnoreScroll>, @@ -199,7 +198,6 @@ pub fn ui_layout_system( &mut UiGlobalTransform, &Node, Option<&LayoutConfig>, - Option<&BorderRadius>, Option<&Outline>, Option<&ScrollPosition>, Option<&IgnoreScroll>, @@ -215,7 +213,6 @@ pub fn ui_layout_system( mut global_transform, style, maybe_layout_config, - maybe_border_radius, maybe_outline, maybe_scroll_position, maybe_scroll_sticky, @@ -279,14 +276,12 @@ pub fn ui_layout_system( *global_transform = inherited_transform.into(); } - if let Some(border_radius) = maybe_border_radius { - // We don't trigger change detection for changes to border radius - node.bypass_change_detection().border_radius = border_radius.resolve( - inverse_target_scale_factor.recip(), - node.size, - target_size, - ); - } + // We don't trigger change detection for changes to border radius + node.bypass_change_detection().border_radius = style.border_radius.resolve( + inverse_target_scale_factor.recip(), + node.size, + target_size, + ); if let Some(outline) = maybe_outline { // don't trigger change detection when only outlines are changed diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index ed75a770b4c43..c349977e18532 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -395,7 +395,6 @@ impl From for IgnoreScroll { UiTransform, BackgroundColor, BorderColor, - BorderRadius, FocusPolicy, ScrollPosition, Visibility, @@ -611,6 +610,45 @@ pub struct Node { /// pub border: UiRect, + /// Used to add rounded corners to a UI node. You can set a UI node to have uniformly + /// rounded corners or specify different radii for each corner. If a given radius exceeds half + /// the length of the smallest dimension between the node's height or width, the radius will + /// calculated as half the smallest dimension. + /// + /// Elliptical nodes are not supported yet. Percentage values are based on the node's smallest + /// dimension, either width or height. + /// + /// # Example + /// ```rust + /// # use bevy_ecs::prelude::*; + /// # use bevy_ui::prelude::*; + /// # use bevy_color::palettes::basic::{BLUE}; + /// fn setup_ui(mut commands: Commands) { + /// commands.spawn(( + /// Node { + /// width: Val::Px(100.), + /// height: Val::Px(100.), + /// border: UiRect::all(Val::Px(2.)), + /// BorderRadius::new( + /// // top left + /// Val::Px(10.), + /// // top right + /// Val::Px(20.), + /// // bottom right + /// Val::Px(30.), + /// // bottom left + /// Val::Px(40.), + /// ), + /// ..Default::default() + /// }, + /// BackgroundColor(BLUE.into()), + /// )); + /// } + /// ``` + /// + /// + pub border_radius: BorderRadius, + /// Whether a Flexbox container should be a row or a column. This property has no effect on Grid nodes. /// /// @@ -712,6 +750,7 @@ impl Node { margin: UiRect::DEFAULT, padding: UiRect::DEFAULT, border: UiRect::DEFAULT, + border_radius: BorderRadius::DEFAULT, flex_grow: 0.0, flex_shrink: 1.0, flex_basis: Val::Auto, @@ -2331,8 +2370,8 @@ pub struct GlobalZIndex(pub i32); /// ``` /// /// -#[derive(Component, Copy, Clone, Debug, PartialEq, Reflect)] -#[reflect(Component, PartialEq, Default, Debug, Clone)] +#[derive(Copy, Clone, Debug, PartialEq, Reflect)] +#[reflect(PartialEq, Default, Debug, Clone)] #[cfg_attr( feature = "serialize", derive(serde::Serialize, serde::Deserialize), diff --git a/examples/ui/borders.rs b/examples/ui/borders.rs index f87f78dd7e736..180286d29505a 100644 --- a/examples/ui/borders.rs +++ b/examples/ui/borders.rs @@ -174,6 +174,12 @@ fn setup(mut commands: Commands) { margin: px(20).all(), align_items: AlignItems::Center, justify_content: JustifyContent::Center, + border_radius: BorderRadius::px( + border_size(border.left, border.top), + border_size(border.right, border.top), + border_size(border.right, border.bottom,), + border_size(border.left, border.bottom), + ), ..default() }, BackgroundColor(MAROON.into()), @@ -183,12 +189,6 @@ fn setup(mut commands: Commands) { left: GREEN.into(), right: BLUE.into(), }, - BorderRadius::px( - border_size(border.left, border.top), - border_size(border.right, border.top), - border_size(border.right, border.bottom,), - border_size(border.left, border.bottom), - ), Outline { width: px(6), offset: px(6), @@ -198,9 +198,9 @@ fn setup(mut commands: Commands) { Node { width: px(10), height: px(10), + border_radius: BorderRadius::MAX, ..default() }, - BorderRadius::MAX, BackgroundColor(YELLOW.into()), )], ), From 8b82e7dc2a797f18949514ed1fc4c4683c7b3dfc Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:22:22 +0000 Subject: [PATCH 02/10] Fixed examples --- examples/3d/clustered_decals.rs | 2 +- examples/3d/color_grading.rs | 2 +- examples/3d/light_textures.rs | 2 +- examples/animation/animation_masks.rs | 2 +- examples/camera/2d_on_ui.rs | 2 +- examples/helpers/widgets.rs | 22 ++++++------ examples/testbed/full_ui.rs | 2 +- examples/testbed/ui.rs | 22 ++++++------ examples/ui/box_shadow.rs | 43 +++++++++++------------ examples/ui/button.rs | 2 +- examples/ui/directional_navigation.rs | 2 +- examples/ui/ghost_nodes.rs | 2 +- examples/ui/gradients.rs | 10 +++--- examples/ui/render_ui_to_texture.rs | 2 +- examples/ui/scrollbars.rs | 4 +-- examples/ui/standard_widgets.rs | 14 ++++---- examples/ui/standard_widgets_observers.rs | 8 ++--- examples/ui/ui_material.rs | 2 +- examples/ui/virtual_keyboard.rs | 2 +- examples/usage/context_menu.rs | 4 +-- 20 files changed, 75 insertions(+), 76 deletions(-) diff --git a/examples/3d/clustered_decals.rs b/examples/3d/clustered_decals.rs index 9dd5249cc86ed..1358d79ecd324 100644 --- a/examples/3d/clustered_decals.rs +++ b/examples/3d/clustered_decals.rs @@ -281,11 +281,11 @@ fn drag_button(label: &str) -> impl Bundle { justify_content: JustifyContent::Center, align_items: AlignItems::Center, padding: BUTTON_PADDING, + border_radius: BorderRadius::all(BUTTON_BORDER_RADIUS_SIZE), ..default() }, Button, BackgroundColor(Color::BLACK), - BorderRadius::all(BUTTON_BORDER_RADIUS_SIZE), BUTTON_BORDER_COLOR, children![widgets::ui_text(label, Color::WHITE)], ) diff --git a/examples/3d/color_grading.rs b/examples/3d/color_grading.rs index 12c6bb2c7099f..14237c2432629 100644 --- a/examples/3d/color_grading.rs +++ b/examples/3d/color_grading.rs @@ -244,10 +244,10 @@ fn button_for_value( align_items: AlignItems::Center, padding: UiRect::axes(px(12), px(6)), margin: UiRect::right(px(12)), + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(Color::WHITE), - BorderRadius::MAX, BackgroundColor(Color::BLACK), ColorGradingOptionWidget { widget_type: ColorGradingOptionWidgetType::Button, diff --git a/examples/3d/light_textures.rs b/examples/3d/light_textures.rs index fef8dab170bf5..079fbb77daa87 100644 --- a/examples/3d/light_textures.rs +++ b/examples/3d/light_textures.rs @@ -329,11 +329,11 @@ fn drag_button(label: &str) -> impl Bundle { justify_content: JustifyContent::Center, align_items: AlignItems::Center, padding: BUTTON_PADDING, + border_radius: BorderRadius::all(BUTTON_BORDER_RADIUS_SIZE), ..default() }, Button, BackgroundColor(Color::BLACK), - BorderRadius::all(BUTTON_BORDER_RADIUS_SIZE), BUTTON_BORDER_COLOR, children![widgets::ui_text(label, Color::WHITE),], ) diff --git a/examples/animation/animation_masks.rs b/examples/animation/animation_masks.rs index f0f0818d6a222..d357850a6319d 100644 --- a/examples/animation/animation_masks.rs +++ b/examples/animation/animation_masks.rs @@ -288,10 +288,10 @@ fn new_mask_group_control(label: &str, width: Val, mask_group_id: u32) -> impl B align_items: AlignItems::Center, padding: UiRect::ZERO, margin: UiRect::ZERO, + border_radius: BorderRadius::all(px(3)), ..default() }, BorderColor::all(Color::WHITE), - BorderRadius::all(px(3)), BackgroundColor(Color::BLACK), children![ ( diff --git a/examples/camera/2d_on_ui.rs b/examples/camera/2d_on_ui.rs index 0a97080f28277..155f1bfa1e8a0 100644 --- a/examples/camera/2d_on_ui.rs +++ b/examples/camera/2d_on_ui.rs @@ -45,9 +45,9 @@ fn setup(mut commands: Commands, asset_server: Res) { min_height: px(150), min_width: px(150), border: UiRect::all(px(2)), + border_radius: BorderRadius::all(percent(25)), ..default() }, - BorderRadius::all(percent(25)), BorderColor::all(Color::WHITE), )], )); diff --git a/examples/helpers/widgets.rs b/examples/helpers/widgets.rs index 041ffaa59f5d8..57b3db77e2942 100644 --- a/examples/helpers/widgets.rs +++ b/examples/helpers/widgets.rs @@ -83,20 +83,20 @@ where justify_content: JustifyContent::Center, align_items: AlignItems::Center, padding: BUTTON_PADDING, + border_radius: BorderRadius::ZERO + .with_left(if is_first { + BUTTON_BORDER_RADIUS_SIZE + } else { + px(0) + }) + .with_right(if is_last { + BUTTON_BORDER_RADIUS_SIZE + } else { + px(0) + }), ..default() }, BUTTON_BORDER_COLOR, - BorderRadius::ZERO - .with_left(if is_first { - BUTTON_BORDER_RADIUS_SIZE - } else { - px(0) - }) - .with_right(if is_last { - BUTTON_BORDER_RADIUS_SIZE - } else { - px(0) - }), BackgroundColor(bg_color), RadioButton, WidgetClickSender(option_value.clone()), diff --git a/examples/testbed/full_ui.rs b/examples/testbed/full_ui.rs index e8644c24e2563..8565271da3e0b 100644 --- a/examples/testbed/full_ui.rs +++ b/examples/testbed/full_ui.rs @@ -230,13 +230,13 @@ fn setup(mut commands: Commands, asset_server: Res) { ImageNode::new(asset_server.load("branding/bevy_logo_light.png")), // Uses the transform to rotate the logo image by 45 degrees Node { + border_radius: BorderRadius::all(px(10)), ..Default::default() }, UiTransform { rotation: Rot2::radians(0.25 * PI), ..Default::default() }, - BorderRadius::all(px(10)), Outline { width: px(2), offset: px(4), diff --git a/examples/testbed/ui.rs b/examples/testbed/ui.rs index 6dc2cbe6d7933..082515430ad43 100644 --- a/examples/testbed/ui.rs +++ b/examples/testbed/ui.rs @@ -337,6 +337,16 @@ mod borders { margin: UiRect::all(px(30)), align_items: AlignItems::Center, justify_content: JustifyContent::Center, + border_radius: if rounded { + BorderRadius::px( + border_size(border.left, border.top), + border_size(border.right, border.top), + border_size(border.right, border.bottom), + border_size(border.left, border.bottom), + ) + } else { + BorderRadius::ZERO + }, ..default() }, BackgroundColor(MAROON.into()), @@ -349,16 +359,6 @@ mod borders { )) .id(); - if rounded { - let border_radius = BorderRadius::px( - border_size(border.left, border.top), - border_size(border.right, border.top), - border_size(border.right, border.bottom), - border_size(border.left, border.bottom), - ); - commands.entity(border_node).insert(border_radius); - } - commands.entity(root).add_child(border_node); } } @@ -430,10 +430,10 @@ mod box_shadow { width: px(size.x), height: px(size.y), border: UiRect::all(px(2)), + border_radius, ..default() }, BorderColor::all(WHITE), - border_radius, BackgroundColor(BLUE.into()), BoxShadow::new( Color::BLACK.with_alpha(0.9), diff --git a/examples/ui/box_shadow.rs b/examples/ui/box_shadow.rs index 130134433ba5d..46dc09851660c 100644 --- a/examples/ui/box_shadow.rs +++ b/examples/ui/box_shadow.rs @@ -17,31 +17,31 @@ const SHADOW_DEFAULT_SETTINGS: ShadowSettings = ShadowSettings { samples: 6, }; -const SHAPES: &[(&str, fn(&mut Node, &mut BorderRadius))] = &[ - ("1", |node, radius| { +const SHAPES: &[(&str, fn(&mut Node))] = &[ + ("1", |node| { node.width = px(164); node.height = px(164); - *radius = BorderRadius::ZERO; + node.border_radius = BorderRadius::ZERO; }), - ("2", |node, radius| { + ("2", |node| { node.width = px(164); node.height = px(164); - *radius = BorderRadius::all(px(41)); + node.border_radius = BorderRadius::all(px(41)); }), - ("3", |node, radius| { + ("3", |node| { node.width = px(164); node.height = px(164); - *radius = BorderRadius::MAX; + node.border_radius = BorderRadius::MAX; }), - ("4", |node, radius| { + ("4", |node| { node.width = px(240); node.height = px(80); - *radius = BorderRadius::all(px(32)); + node.border_radius = BorderRadius::all(px(32)); }), - ("5", |node, radius| { + ("5", |node| { node.width = px(80); node.height = px(240); - *radius = BorderRadius::all(px(32)); + node.border_radius = BorderRadius::all(px(32)); }), ]; @@ -162,15 +162,14 @@ fn setup( border: UiRect::all(px(1)), align_items: AlignItems::Center, justify_content: JustifyContent::Center, + border_radius: BorderRadius::ZERO, ..default() }; - let mut radius = BorderRadius::ZERO; - SHAPES[shape.index % SHAPES.len()].1(&mut node, &mut radius); + SHAPES[shape.index % SHAPES.len()].1(&mut node); ( node, BorderColor::all(WHITE), - radius, BackgroundColor(Color::srgb(0.21, 0.21, 0.21)), BoxShadow(vec![ShadowStyle { color: Color::BLACK.with_alpha(0.8), @@ -193,11 +192,11 @@ fn setup( bottom: px(24), width: px(270), padding: UiRect::all(px(16)), + border_radius: BorderRadius::all(px(12)), ..default() }, BackgroundColor(Color::srgb(0.12, 0.12, 0.12).with_alpha(0.85)), BorderColor::all(Color::WHITE.with_alpha(0.15)), - BorderRadius::all(px(12)), ZIndex(10), )) .insert(children![ @@ -267,10 +266,10 @@ fn setup( height: px(32), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::all(px(8)), ..default() }, BackgroundColor(NORMAL_BUTTON), - BorderRadius::all(px(8)), SettingsButton::Reset, children![( Text::new("Reset"), @@ -334,10 +333,10 @@ fn build_setting_row( margin: UiRect::left(px(8)), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::all(px(6)), ..default() }, BackgroundColor(Color::WHITE), - BorderRadius::all(px(6)), dec, children![( Text::new(if setting_type == SettingType::Shape { @@ -359,9 +358,9 @@ fn build_setting_row( margin: UiRect::horizontal(px(8)), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::all(px(6)), ..default() }, - BorderRadius::all(px(6)), children![{ ( Text::new(value_text), @@ -381,10 +380,10 @@ fn build_setting_row( height: px(28), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::all(px(6)), ..default() }, BackgroundColor(Color::WHITE), - BorderRadius::all(px(6)), inc, children![( Text::new(if setting_type == SettingType::Shape { @@ -503,11 +502,11 @@ fn make_shadow(color: Color, x_offset: f32, y_offset: f32, spread: f32, blur: f3 // Update shape of ShadowNode if shape selection changed fn update_shape( shape: Res, - mut query: Query<(&mut Node, &mut BorderRadius), With>, + mut query: Query<&mut Node, With>, mut label_query: Query<(&mut Text, &SettingType)>, ) { - for (mut node, mut radius) in &mut query { - SHAPES[shape.index % SHAPES.len()].1(&mut node, &mut radius); + for mut node in &mut query { + SHAPES[shape.index % SHAPES.len()].1(&mut node); } for (mut text, kind) in &mut label_query { if *kind == SettingType::Shape { diff --git a/examples/ui/button.rs b/examples/ui/button.rs index b2090ee4dd16b..811a986122d33 100644 --- a/examples/ui/button.rs +++ b/examples/ui/button.rs @@ -89,10 +89,10 @@ fn button(asset_server: &AssetServer) -> impl Bundle { justify_content: JustifyContent::Center, // vertically center child text align_items: AlignItems::Center, + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(Color::WHITE), - BorderRadius::MAX, BackgroundColor(Color::BLACK), children![( Text::new("Button"), diff --git a/examples/ui/directional_navigation.rs b/examples/ui/directional_navigation.rs index e0f303290cd09..eb8909d438b80 100644 --- a/examples/ui/directional_navigation.rs +++ b/examples/ui/directional_navigation.rs @@ -174,10 +174,10 @@ fn setup_ui( // Center the button within the grid cell align_self: AlignSelf::Center, justify_self: JustifySelf::Center, + border_radius: BorderRadius::all(px(16)), ..default() }, ResetTimer::default(), - BorderRadius::all(px(16)), BackgroundColor::from(NORMAL_BUTTON), Name::new(button_name.clone()), )) diff --git a/examples/ui/ghost_nodes.rs b/examples/ui/ghost_nodes.rs index 4d68724b3beec..f2d8c0930f09d 100644 --- a/examples/ui/ghost_nodes.rs +++ b/examples/ui/ghost_nodes.rs @@ -80,10 +80,10 @@ fn create_button() -> impl Bundle { justify_content: JustifyContent::Center, // vertically center child text align_items: AlignItems::Center, + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(Color::BLACK), - BorderRadius::MAX, BackgroundColor(Color::srgb(0.15, 0.15, 0.15)), ) } diff --git a/examples/ui/gradients.rs b/examples/ui/gradients.rs index c0dc64346d099..f6a6ae04f8db6 100644 --- a/examples/ui/gradients.rs +++ b/examples/ui/gradients.rs @@ -84,9 +84,9 @@ fn setup(mut commands: Commands) { width: px(w), height: px(h), border: UiRect::all(px(b)), + border_radius: BorderRadius::all(px(20)), ..default() }, - BorderRadius::all(px(20)), BackgroundGradient::from(LinearGradient { angle, stops: stops.clone(), @@ -114,9 +114,9 @@ fn setup(mut commands: Commands) { height: percent(100), border: UiRect::all(px(b)), margin: UiRect::left(px(20)), + border_radius: BorderRadius::all(px(20)), ..default() }, - BorderRadius::all(px(20)), BackgroundGradient::from(LinearGradient { angle: 0., stops: stops.clone(), @@ -136,9 +136,9 @@ fn setup(mut commands: Commands) { height: percent(100), border: UiRect::all(px(b)), margin: UiRect::left(px(20)), + border_radius: BorderRadius::all(px(20)), ..default() }, - BorderRadius::all(px(20)), BackgroundGradient::from(RadialGradient { stops: stops.clone(), shape: RadialGradientShape::ClosestSide, @@ -158,9 +158,9 @@ fn setup(mut commands: Commands) { height: percent(100), border: UiRect::all(px(b)), margin: UiRect::left(px(20)), + border_radius: BorderRadius::all(px(20)), ..default() }, - BorderRadius::all(px(20)), BackgroundGradient::from(ConicGradient { start: 0., stops: stops @@ -190,10 +190,10 @@ fn setup(mut commands: Commands) { justify_content: JustifyContent::Center, // vertically center child text align_items: AlignItems::Center, + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(Color::WHITE), - BorderRadius::MAX, BackgroundColor(Color::BLACK), children![( Text::new("next color space"), diff --git a/examples/ui/render_ui_to_texture.rs b/examples/ui/render_ui_to_texture.rs index cbc78c20f4f76..cc702dbf39a57 100644 --- a/examples/ui/render_ui_to_texture.rs +++ b/examples/ui/render_ui_to_texture.rs @@ -96,9 +96,9 @@ fn setup( height: Val::Auto, align_items: AlignItems::Center, padding: UiRect::all(Val::Px(20.)), + border_radius: BorderRadius::all(Val::Px(10.)), ..default() }, - BorderRadius::all(Val::Px(10.)), BackgroundColor(BLUE.into()), )) .observe( diff --git a/examples/ui/scrollbars.rs b/examples/ui/scrollbars.rs index f5dedeea5069d..96c55113179f3 100644 --- a/examples/ui/scrollbars.rs +++ b/examples/ui/scrollbars.rs @@ -120,11 +120,11 @@ fn scroll_area_demo() -> impl Bundle { Children::spawn(Spawn(( Node { position_type: PositionType::Absolute, + border_radius: BorderRadius::all(px(4)), ..default() }, Hovered::default(), BackgroundColor(colors::GRAY2.into()), - BorderRadius::all(px(4)), CoreScrollbarThumb, ))), )); @@ -145,11 +145,11 @@ fn scroll_area_demo() -> impl Bundle { Children::spawn(Spawn(( Node { position_type: PositionType::Absolute, + border_radius: BorderRadius::all(px(4)), ..default() }, Hovered::default(), BackgroundColor(colors::GRAY2.into()), - BorderRadius::all(px(4)), CoreScrollbarThumb, ))), )); diff --git a/examples/ui/standard_widgets.rs b/examples/ui/standard_widgets.rs index f3308b0d5e86a..99149bc6065fa 100644 --- a/examples/ui/standard_widgets.rs +++ b/examples/ui/standard_widgets.rs @@ -200,6 +200,7 @@ fn button(asset_server: &AssetServer) -> impl Bundle { width: px(150), height: px(65), border: UiRect::all(px(5)), + border_radius: BorderRadius::MAX, justify_content: JustifyContent::Center, align_items: AlignItems::Center, ..default() @@ -209,7 +210,6 @@ fn button(asset_server: &AssetServer) -> impl Bundle { Hovered::default(), TabIndex(0), BorderColor::all(Color::BLACK), - BorderRadius::MAX, BackgroundColor(NORMAL_BUTTON), children![( Text::new("Button"), @@ -238,6 +238,7 @@ fn menu_button(asset_server: &AssetServer) -> impl Bundle { justify_content: JustifyContent::SpaceBetween, align_items: AlignItems::Center, padding: UiRect::axes(px(16), px(0)), + border_radius: BorderRadius::all(px(5)), ..default() }, DemoMenuButton, @@ -245,7 +246,6 @@ fn menu_button(asset_server: &AssetServer) -> impl Bundle { Hovered::default(), TabIndex(0), BorderColor::all(Color::BLACK), - BorderRadius::all(px(5)), BackgroundColor(NORMAL_BUTTON), children![ ( @@ -409,10 +409,10 @@ fn slider(min: f32, max: f32, value: f32) -> impl Bundle { Spawn(( Node { height: px(6), + border_radius: BorderRadius::all(px(3)), ..default() }, BackgroundColor(SLIDER_TRACK), // Border color for the slider - BorderRadius::all(px(3)), )), // Invisible track to allow absolute placement of thumb entity. This is narrower than // the actual slider, which allows us to position the thumb entity using simple @@ -438,9 +438,9 @@ fn slider(min: f32, max: f32, value: f32) -> impl Bundle { height: px(12), position_type: PositionType::Absolute, left: percent(0), // This will be updated by the slider's value + border_radius: BorderRadius::MAX, ..default() }, - BorderRadius::MAX, BackgroundColor(SLIDER_THUMB), )], )), @@ -547,10 +547,10 @@ fn checkbox(asset_server: &AssetServer, caption: &str) -> impl Bundle { width: px(16), height: px(16), border: UiRect::all(px(2)), + border_radius: BorderRadius::all(px(3)), ..default() }, BorderColor::all(ELEMENT_OUTLINE), // Border color for the checkbox - BorderRadius::all(px(3)), children![ // Checkbox inner ( @@ -759,10 +759,10 @@ fn radio(asset_server: &AssetServer, value: TrackClick, caption: &str) -> impl B width: px(16), height: px(16), border: UiRect::all(px(2)), + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(ELEMENT_OUTLINE), // Border color for the radio button - BorderRadius::MAX, children![ // Radio inner ( @@ -773,9 +773,9 @@ fn radio(asset_server: &AssetServer, value: TrackClick, caption: &str) -> impl B position_type: PositionType::Absolute, left: px(2), top: px(2), + border_radius: BorderRadius::MAX, ..default() }, - BorderRadius::MAX, BackgroundColor(ELEMENT_FILL), ), ], diff --git a/examples/ui/standard_widgets_observers.rs b/examples/ui/standard_widgets_observers.rs index 07a3bbda1fc0e..4bed7b5c5b257 100644 --- a/examples/ui/standard_widgets_observers.rs +++ b/examples/ui/standard_widgets_observers.rs @@ -136,6 +136,7 @@ fn button(asset_server: &AssetServer) -> impl Bundle { border: UiRect::all(px(5)), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::MAX, ..default() }, DemoButton, @@ -143,7 +144,6 @@ fn button(asset_server: &AssetServer) -> impl Bundle { Hovered::default(), TabIndex(0), BorderColor::all(Color::BLACK), - BorderRadius::MAX, BackgroundColor(NORMAL_BUTTON), children![( Text::new("Button"), @@ -245,10 +245,10 @@ fn slider(min: f32, max: f32, value: f32) -> impl Bundle { Spawn(( Node { height: px(6), + border_radius: BorderRadius::all(px(3)), ..default() }, BackgroundColor(SLIDER_TRACK), // Border color for the checkbox - BorderRadius::all(px(3)), )), // Invisible track to allow absolute placement of thumb entity. This is narrower than // the actual slider, which allows us to position the thumb entity using simple @@ -274,9 +274,9 @@ fn slider(min: f32, max: f32, value: f32) -> impl Bundle { height: px(12), position_type: PositionType::Absolute, left: percent(0), // This will be updated by the slider's value + border_radius: BorderRadius::MAX, ..default() }, - BorderRadius::MAX, BackgroundColor(SLIDER_THUMB), )], )), @@ -356,10 +356,10 @@ fn checkbox(asset_server: &AssetServer, caption: &str) -> impl Bundle { width: px(16), height: px(16), border: UiRect::all(px(2)), + border_radius: BorderRadius::all(px(3)), ..default() }, BorderColor::all(CHECKBOX_OUTLINE), // Border color for the checkbox - BorderRadius::all(px(3)), children![ // Checkbox inner ( diff --git a/examples/ui/ui_material.rs b/examples/ui/ui_material.rs index f283c1be8887d..af6625ae773ec 100644 --- a/examples/ui/ui_material.rs +++ b/examples/ui/ui_material.rs @@ -41,6 +41,7 @@ fn setup( width: px(905.0 * banner_scale_factor), height: px(363.0 * banner_scale_factor), border: UiRect::all(px(20)), + border_radius: BorderRadius::all(px(20)), ..default() }, MaterialNode(ui_materials.add(CustomUiMaterial { @@ -49,7 +50,6 @@ fn setup( color_texture: asset_server.load("branding/banner.png"), border_color: LinearRgba::WHITE.to_f32_array().into(), })), - BorderRadius::all(px(20)), // UI material nodes can have outlines and shadows like any other UI node Outline { width: px(2), diff --git a/examples/ui/virtual_keyboard.rs b/examples/ui/virtual_keyboard.rs index e423adc1737bc..918b1a1054fbb 100644 --- a/examples/ui/virtual_keyboard.rs +++ b/examples/ui/virtual_keyboard.rs @@ -53,11 +53,11 @@ fn setup(mut commands: Commands) { padding: px(5).into(), align_items: AlignItems::Center, margin: px(25).into(), + border_radius: BorderRadius::all(px(10)), ..Default::default() }, BackgroundColor(NAVY.into()), BorderColor::all(Color::WHITE), - BorderRadius::all(px(10)), children![ Text::new("virtual keyboard"), ( diff --git a/examples/usage/context_menu.rs b/examples/usage/context_menu.rs index b593a2e0753ee..dd83396d41a1f 100644 --- a/examples/usage/context_menu.rs +++ b/examples/usage/context_menu.rs @@ -94,10 +94,10 @@ fn on_trigger_menu(event: On, mut commands: Commands) { left: px(pos.x), top: px(pos.y), flex_direction: FlexDirection::Column, + border_radius: BorderRadius::all(px(4)), ..default() }, BorderColor::all(Color::BLACK), - BorderRadius::all(px(4)), BackgroundColor(Color::linear_rgb(0.1, 0.1, 0.1)), children![ context_item("fuchsia", basic::FUCHSIA), @@ -165,10 +165,10 @@ fn background_and_button() -> impl Bundle { border: UiRect::all(px(5)), justify_content: JustifyContent::Center, align_items: AlignItems::Center, + border_radius: BorderRadius::MAX, ..default() }, BorderColor::all(Color::BLACK), - BorderRadius::MAX, BackgroundColor(Color::BLACK), children![( Pickable::IGNORE, From ee3cc987f77bf271bb2d1d1a3a752395bbeb9682 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:22:39 +0000 Subject: [PATCH 03/10] Fixed feathers --- crates/bevy_feathers/src/controls/checkbox.rs | 2 +- crates/bevy_feathers/src/controls/color_plane.rs | 4 ++-- crates/bevy_feathers/src/controls/color_slider.rs | 8 ++++---- crates/bevy_feathers/src/controls/color_swatch.rs | 6 +++--- crates/bevy_feathers/src/controls/radio.rs | 4 ++-- crates/bevy_feathers/src/controls/toggle_switch.rs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/bevy_feathers/src/controls/checkbox.rs b/crates/bevy_feathers/src/controls/checkbox.rs index e3a7999419685..eb12a928a9cd3 100644 --- a/crates/bevy_feathers/src/controls/checkbox.rs +++ b/crates/bevy_feathers/src/controls/checkbox.rs @@ -88,10 +88,10 @@ pub fn checkbox + Send + Sync + 'static, B: Bundle>( width: size::CHECKBOX_SIZE, height: size::CHECKBOX_SIZE, border: UiRect::all(Val::Px(2.0)), + border_radius: BorderRadius::all(Val::Px(4.0)), ..Default::default() }, CheckboxOutline, - BorderRadius::all(Val::Px(4.0)), ThemeBackgroundColor(tokens::CHECKBOX_BG), ThemeBorderColor(tokens::CHECKBOX_BORDER), children![( diff --git a/crates/bevy_feathers/src/controls/color_plane.rs b/crates/bevy_feathers/src/controls/color_plane.rs index cc01a43668764..c39c5432c8d65 100644 --- a/crates/bevy_feathers/src/controls/color_plane.rs +++ b/crates/bevy_feathers/src/controls/color_plane.rs @@ -136,12 +136,12 @@ pub fn color_plane(plane: ColorPlane, overrides: B) -> impl Bundle { min_height: px(100.0), align_self: AlignSelf::Stretch, padding: UiRect::all(px(4)), + border_radius: BorderRadius::all(px(5)), ..Default::default() }, plane, ColorPlaneValue::default(), ThemeBackgroundColor(tokens::COLOR_PLANE_BG), - BorderRadius::all(px(5)), EntityCursor::System(bevy_window::SystemCursorIcon::Crosshair), overrides, children![( @@ -159,10 +159,10 @@ pub fn color_plane(plane: ColorPlane, overrides: B) -> impl Bundle { width: px(10), height: px(10), border: UiRect::all(Val::Px(1.0)), + border_radius: BorderRadius::MAX, ..Default::default() }, ColorPlaneThumb, - BorderRadius::MAX, BorderColor::all(palette::WHITE), Outline { width: Val::Px(1.), diff --git a/crates/bevy_feathers/src/controls/color_slider.rs b/crates/bevy_feathers/src/controls/color_slider.rs index c221ad54ffa82..348bd0d50c18c 100644 --- a/crates/bevy_feathers/src/controls/color_slider.rs +++ b/crates/bevy_feathers/src/controls/color_slider.rs @@ -215,9 +215,9 @@ pub fn color_slider(props: ColorSliderProps, overrides: B) -> impl Bu right: Val::Px(0.), top: Val::Px(TRACK_PADDING), bottom: Val::Px(TRACK_PADDING), + border_radius: RoundedCorners::All.to_border_radius(TRACK_RADIUS), ..Default::default() }, - RoundedCorners::All.to_border_radius(TRACK_RADIUS), ColorSliderTrack, AlphaPattern, MaterialNode::(Handle::default()), @@ -226,9 +226,9 @@ pub fn color_slider(props: ColorSliderProps, overrides: B) -> impl Bu ( Node { width: Val::Px(THUMB_SIZE * 0.5), + border_radius: RoundedCorners::Left.to_border_radius(TRACK_RADIUS), ..Default::default() }, - RoundedCorners::Left.to_border_radius(TRACK_RADIUS), BackgroundColor(palette::X_AXIS), ), // Track with gradient @@ -255,11 +255,11 @@ pub fn color_slider(props: ColorSliderProps, overrides: B) -> impl Bu width: Val::Px(THUMB_SIZE), height: Val::Px(THUMB_SIZE), border: UiRect::all(Val::Px(2.0)), + border_radius: BorderRadius::MAX, ..Default::default() }, SliderThumb, ColorSliderThumb, - BorderRadius::MAX, BorderColor::all(palette::WHITE), Outline { width: Val::Px(1.), @@ -276,9 +276,9 @@ pub fn color_slider(props: ColorSliderProps, overrides: B) -> impl Bu ( Node { width: Val::Px(THUMB_SIZE * 0.5), + border_radius: RoundedCorners::Right.to_border_radius(TRACK_RADIUS), ..Default::default() }, - RoundedCorners::Right.to_border_radius(TRACK_RADIUS), BackgroundColor(palette::Z_AXIS), ), ] diff --git a/crates/bevy_feathers/src/controls/color_swatch.rs b/crates/bevy_feathers/src/controls/color_swatch.rs index 455e832ec1a02..0214aa90be4a9 100644 --- a/crates/bevy_feathers/src/controls/color_swatch.rs +++ b/crates/bevy_feathers/src/controls/color_swatch.rs @@ -48,13 +48,13 @@ pub fn color_swatch(overrides: B) -> impl Bundle { Node { height: size::ROW_HEIGHT, min_width: size::ROW_HEIGHT, + border_radius: BorderRadius::all(Val::Px(5.0)), ..Default::default() }, ColorSwatch, ColorSwatchValue::default(), AlphaPattern, MaterialNode::(Handle::default()), - BorderRadius::all(Val::Px(5.0)), overrides, children![( Node { @@ -63,12 +63,12 @@ pub fn color_swatch(overrides: B) -> impl Bundle { top: Val::Px(0.), bottom: Val::Px(0.), right: Val::Px(0.), + border_radius: BorderRadius::all(Val::Px(5.0)), ..Default::default() }, ColorSwatchFg, BackgroundColor(palette::ACCENT.with_alpha(0.5)), - BorderRadius::all(Val::Px(5.0)) - ),], + )], ) } diff --git a/crates/bevy_feathers/src/controls/radio.rs b/crates/bevy_feathers/src/controls/radio.rs index 4d31155e53f2a..92945b1291f60 100644 --- a/crates/bevy_feathers/src/controls/radio.rs +++ b/crates/bevy_feathers/src/controls/radio.rs @@ -85,19 +85,19 @@ pub fn radio + Send + Sync + 'static, B: Bundle>( width: size::RADIO_SIZE, height: size::RADIO_SIZE, border: UiRect::all(Val::Px(2.0)), + border_radius: BorderRadius::MAX, ..Default::default() }, RadioOutline, - BorderRadius::MAX, ThemeBorderColor(tokens::RADIO_BORDER), children![( // Cheesy checkmark: rotated node with L-shaped border. Node { width: Val::Px(8.), height: Val::Px(8.), + border_radius: BorderRadius::MAX, ..Default::default() }, - BorderRadius::MAX, RadioMark, ThemeBackgroundColor(tokens::RADIO_MARK), )], diff --git a/crates/bevy_feathers/src/controls/toggle_switch.rs b/crates/bevy_feathers/src/controls/toggle_switch.rs index 9b119acaa88de..2d338fb668227 100644 --- a/crates/bevy_feathers/src/controls/toggle_switch.rs +++ b/crates/bevy_feathers/src/controls/toggle_switch.rs @@ -54,11 +54,11 @@ pub fn toggle_switch(overrides: B) -> impl Bundle { width: size::TOGGLE_WIDTH, height: size::TOGGLE_HEIGHT, border: UiRect::all(Val::Px(2.0)), + border_radius: BorderRadius::all(Val::Px(5.0)), ..Default::default() }, Checkbox, ToggleSwitchOutline, - BorderRadius::all(Val::Px(5.0)), ThemeBackgroundColor(tokens::SWITCH_BG), ThemeBorderColor(tokens::SWITCH_BORDER), AccessibilityNode(accesskit::Node::new(Role::Switch)), @@ -73,9 +73,9 @@ pub fn toggle_switch(overrides: B) -> impl Bundle { top: Val::Px(0.), bottom: Val::Px(0.), width: Val::Percent(50.), + border_radius: BorderRadius::all(Val::Px(3.0)), ..Default::default() }, - BorderRadius::all(Val::Px(3.0)), ToggleSwitchSlide, ThemeBackgroundColor(tokens::SWITCH_SLIDE), )], From bab0f84636e9740799efaacf3055dca103c57a63 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:26:23 +0000 Subject: [PATCH 04/10] Added migration guide --- .../border_radius_is_now_a_field_on_node.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 release-content/migration-guides/border_radius_is_now_a_field_on_node.md diff --git a/release-content/migration-guides/border_radius_is_now_a_field_on_node.md b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md new file mode 100644 index 0000000000000..ce2c35f4a0663 --- /dev/null +++ b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md @@ -0,0 +1,6 @@ +--- +title: "`AmbientLight` split into a component and a resource" +pull_requests: [21781] +--- + +`BorderRadius` is no longer a component, instead a `border_radius: BorderRadius` field has been added to `Node`. \ No newline at end of file From 84fec1351bef981dae52284cdcd5b67619b411fb Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:26:36 +0000 Subject: [PATCH 05/10] Fixed migration guide's title --- .../migration-guides/border_radius_is_now_a_field_on_node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-content/migration-guides/border_radius_is_now_a_field_on_node.md b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md index ce2c35f4a0663..e74e3324f228d 100644 --- a/release-content/migration-guides/border_radius_is_now_a_field_on_node.md +++ b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md @@ -1,5 +1,5 @@ --- -title: "`AmbientLight` split into a component and a resource" +title: "`BorderRadius` has been added to `Node` and is no longer a component" pull_requests: [21781] --- From 1c916bf26834e61909aea7613a89aab6217a807a Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:27:44 +0000 Subject: [PATCH 06/10] Added trailing newline to migration guide. --- .../migration-guides/border_radius_is_now_a_field_on_node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-content/migration-guides/border_radius_is_now_a_field_on_node.md b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md index e74e3324f228d..c55d5806be6c4 100644 --- a/release-content/migration-guides/border_radius_is_now_a_field_on_node.md +++ b/release-content/migration-guides/border_radius_is_now_a_field_on_node.md @@ -3,4 +3,4 @@ title: "`BorderRadius` has been added to `Node` and is no longer a component" pull_requests: [21781] --- -`BorderRadius` is no longer a component, instead a `border_radius: BorderRadius` field has been added to `Node`. \ No newline at end of file +`BorderRadius` is no longer a component, instead a `border_radius: BorderRadius` field has been added to `Node`. From b4b3b2bda6952de69e7fe6986ce9f08a9f8e7256 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:36:30 +0000 Subject: [PATCH 07/10] Fixed slider function --- crates/bevy_feathers/src/controls/slider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_feathers/src/controls/slider.rs b/crates/bevy_feathers/src/controls/slider.rs index f03bd24554f5b..00724843f1bcc 100644 --- a/crates/bevy_feathers/src/controls/slider.rs +++ b/crates/bevy_feathers/src/controls/slider.rs @@ -86,6 +86,7 @@ pub fn slider(props: SliderProps, overrides: B) -> impl Bundle { align_items: AlignItems::Center, padding: UiRect::axes(Val::Px(8.0), Val::Px(0.)), flex_grow: 1.0, + border_radius: RoundedCorners::All.to_border_radius(6.0), ..Default::default() }, Slider { @@ -96,7 +97,6 @@ pub fn slider(props: SliderProps, overrides: B) -> impl Bundle { SliderRange::new(props.min, props.max), EntityCursor::System(bevy_window::SystemCursorIcon::EwResize), TabIndex(0), - RoundedCorners::All.to_border_radius(6.0), // Use a gradient to draw the moving bar BackgroundGradient(vec![Gradient::Linear(LinearGradient { angle: PI * 0.5, From 6042e4e509575d68219d44db770d68ec5635c492 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:37:51 +0000 Subject: [PATCH 08/10] Fixed feathers button constructor --- crates/bevy_feathers/src/controls/button.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_feathers/src/controls/button.rs b/crates/bevy_feathers/src/controls/button.rs index 731017d4b8c11..b35d8e6b7f80f 100644 --- a/crates/bevy_feathers/src/controls/button.rs +++ b/crates/bevy_feathers/src/controls/button.rs @@ -74,6 +74,7 @@ pub fn button + Send + Sync + 'static, B: Bundle>( align_items: AlignItems::Center, padding: UiRect::axes(Val::Px(8.0), Val::Px(0.)), flex_grow: 1.0, + border_radius: props.corners.to_border_radius(4.0), ..Default::default() }, Button, @@ -81,7 +82,6 @@ pub fn button + Send + Sync + 'static, B: Bundle>( Hovered::default(), EntityCursor::System(bevy_window::SystemCursorIcon::Pointer), TabIndex(0), - props.corners.to_border_radius(4.0), ThemeBackgroundColor(tokens::BUTTON_BG), ThemeFontColor(tokens::BUTTON_TEXT), InheritableFont { From be9a96218ea5341554a7167cc960eda154fac7c9 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sun, 9 Nov 2025 23:52:31 +0000 Subject: [PATCH 09/10] Updated doc comments --- crates/bevy_ui/src/ui_node.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index c349977e18532..ac086d02a5556 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -629,7 +629,7 @@ pub struct Node { /// width: Val::Px(100.), /// height: Val::Px(100.), /// border: UiRect::all(Val::Px(2.)), - /// BorderRadius::new( + /// border_radius: BorderRadius::new( /// // top left /// Val::Px(10.), /// // top right @@ -2352,19 +2352,19 @@ pub struct GlobalZIndex(pub i32); /// width: Val::Px(100.), /// height: Val::Px(100.), /// border: UiRect::all(Val::Px(2.)), +/// border_radius: BorderRadius::new( +/// // top left +/// Val::Px(10.), +/// // top right +/// Val::Px(20.), +/// // bottom right +/// Val::Px(30.), +/// // bottom left +/// Val::Px(40.), +/// ), /// ..Default::default() /// }, /// BackgroundColor(BLUE.into()), -/// BorderRadius::new( -/// // top left -/// Val::Px(10.), -/// // top right -/// Val::Px(20.), -/// // bottom right -/// Val::Px(30.), -/// // bottom left -/// Val::Px(40.), -/// ), /// )); /// } /// ``` From 00fe771dc7552bbf864a78b074a14c2c8df3631d Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Tue, 11 Nov 2025 09:53:22 +0000 Subject: [PATCH 10/10] fixed example --- examples/ui/auto_directional_navigation.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/ui/auto_directional_navigation.rs b/examples/ui/auto_directional_navigation.rs index 20b05f5318265..58dc14dbd6dd0 100644 --- a/examples/ui/auto_directional_navigation.rs +++ b/examples/ui/auto_directional_navigation.rs @@ -144,10 +144,10 @@ fn setup_scattered_ui(mut commands: Commands, mut input_focus: ResMut